Search This Blog

Sep 23, 2013

C program to evaulate the expression (i) a+b (ii) a-b (iii)axb (iv) a/b (v) ramainder of a/b.

/* Write a program to evaulate the expression (i) a+b (ii) a-b (iii)axb (iv)
a/b (v) ramainder of a/b. */
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,pls,mns,pro,dvd,mod;
clrscr();
printf("Enter the value of a: ");
scanf("%d",&a);
printf("Enter the value of b: ");
scanf("%d",&b);
pls=a+b,mns=a-b,pro=a*b,dvd=a/b,mod=a%b;
printf("\na+b= %d\na-b= %d\na*b= %d\na/b= %d (devider)\na/b= %d (remainder)",pls,mns,pro,dvd,mod);
getch();
}

No comments:

Post a Comment