C program for add,sub,mul,div,rem, C/C++ Programming

C Program for ADD,SUB,MUL,DIV,REM

void main()

{

 

int a,b,c,ch=0;

          clrscr();

          while(ch<=5)

          {

printf(" \n\n 1:- For To Add\n 2:- For To Sub\n 3:- For To Mul\n 4:- For To Div\n 5:- For To Rem\n 6:- For To Exit");

          printf("\nENTER YOUR CHOICE=");

          flushall();

          scanf("%d",&ch);

          switch(ch)

          {

                   case 1:

                             printf("ENTER THE FIRST VALUE=");

                             flushall();

                             scanf("%d",&a);

                             printf("ENTER THE SECOND VALUE=");

                             flushall();

                             scanf("%d",&b);

                             c=a+b;

                             printf("THE SUM OF %d AND %d IS=%d",a,b,c);

                             break;

 

                   case 2:

                             printf("ENTER THE FIRST VALUE=");

                             flushall();

                             scanf("%d",&a);

                             printf("ENTER THE SECOND VALUE=");

                             flushall();

                             scanf("%d",&b);

                             c=a-b;

                             printf("THE SUB OF %d AND %d IS=%d",a,b,c);

                             break;

 

                   case 3:

                             printf("ENTER THE FIRST VALUE=");

                             flushall();

                             scanf("%d",&a);

                             printf("ENTER THE SECOND VALUE=");

                             flus000hall();

                             scanf("%d",&b);

                             c=a*b;

                             printf("THE MUL OF %d AND %d IS=%d",a,b,c);

                             break;

 

          case 4:

                             printf("ENTER THE FIRST VALUE=");

                             flushall();

                             scanf("%d",&a);

                             printf("ENTER THE SECOND VALUE=");

                             flushall();

                             scanf("%d",&b);

                             c=a/b;

                             printf("THE DIV OF %d AND %d IS=%d",a,b,c);

                             break;

 

case 5:

                             printf("ENTER THE FIRST VALUE=");

                             flushall();

                             scanf("%d",&a);

                             printf("ENTER THE SECOND VALUE=");

                             flushall();

                             scanf("%d",&b);

                             c=a%b;

                             printf("THE REM OF %d AND %d IS=%d",a,b,c);

                             break;

                   }

          }

          getch();

}

OUTPUT :
1 FOR TO ADD.
2 FOR TO SUB.
3 FOR TO MUL.
4 FOR TO DIV.
5 FOR TO REM.
6 FOR TO EXIT
ENTER YOUR CHOICE: 1
ENTER 1 NO: 5
ENTER 2 NO: 5
THE SUM OF 5 AND 5 IS 10

Posted Date: 9/10/2012 2:21:20 AM | Location : United States





c prog convert is cpp prog
Posted by Monali koli | Posted Date: 7/13/2013 2:21:15 AM


Related Discussions:- C program for add,sub,mul,div,rem, Assignment Help, Ask Question on C program for add,sub,mul,div,rem, Get Answer, Expert's Help, C program for add,sub,mul,div,rem Discussions

Write discussion on C program for add,sub,mul,div,rem
Your posts are moderated
Related Questions
Use the above problem and have the program print the biggest and smallest sales for each employee for everyday of the month. Program should also find the largest and

A: Mostly can be overloaded. The only C operators which can't be are. and?: (and sizeof, that is technically an operator). C++ adds a few of its own operators, mostly which can be

#an array that accept input and gives an output

THIS PROGRAM IS TO COMPARE THE TWO DATES GIVEN BY THE USER #include #include #include struct date  {   int dd;   int mm;   int yy;  }; date compare(date d1,date d2)  {

Q: How the compiler arranges the several sections in the executable image? A: The executable contained following sections: 1.      Data Section (initialized data variable sec

Project Description: Design and prepare software that can navigate a mobile robot using SLAM technique using vision sensor (camera). Skills required are C Programming, Engine

in a program for what purpose print f and scan f is used

Write a program called A1Q3, that reads it the radius of a circle as an integer and prints the circle's diameter, circumference and area.  Use a constant value for pi.  Do all calc

Explain what are Unions? The Unions like as structures, contain members whose individual data types may perhaps differ from one another. Though the members that create a union

Project Description: I posted listings on a site that is like eBay but for video games. I post the similar listing many times daily, but need something that will let me post