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

Assignment Help:

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


Related Discussions:- C program for add,sub,mul,div,rem

Define passing structure to a function, Define Passing Structure to a Funct...

Define Passing Structure to a Function? A structure is able to be passed as a function argument identical to any other variable. If we are merely interested in one member of a

Padovan string, c program to count the number of occurances of the string i...

c program to count the number of occurances of the string in padovan''s string

Program to calculation of mortgage interest rates, This assignment builds o...

This assignment builds on Homework 3. The two major modifications are the instruction of pointers and the calculation of mortgage interest rates. Requirements for Project 2:

.program, Write a c++ program to find the sum of 0.123 ??103 and 0.456 ??10...

Write a c++ program to find the sum of 0.123 ??103 and 0.456 ??102 and write the result in three significant digits

Boardcoloring, how to fill the blank space in4*4 matrix?

how to fill the blank space in4*4 matrix?

Friend function, Ask question #Minimum 100 what is friend function is used ...

Ask question #Minimum 100 what is friend function is used in c++

Described storage qualifiers in c++ ?, A: They are following: Const: poi...

A: They are following: Const: point out that memory once initialized, must not be modify through a program. Volatile: denote that value in the memory location can be modified

Car rental project, I need a project on car rental system using c programmi...

I need a project on car rental system using c programming only of college level

Computer graphics, .Develop a two dimensional interactive game with the fol...

.Develop a two dimensional interactive game with the following features: 1. Use OpenGL (any version you find convenient) 2. The game can either be two player or one player with the

Skilled programmer is required to build a standalone module, A skilled prog...

A skilled programmer is required to build a standalone module to extract, parse and store in database tables, word count data from web pages and RSS feeds. The module can take R

Monali koli

7/13/2013 2:21:15 AM

c prog convert is cpp prog

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd