answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

void main()

{

int a, b, c, d, e, f, ch;

printf("Enter the first no. : ");

scanf("%d", &a);

printf("Enter the second no. : ");

scanf("%d", &b);

printf("Enter the choice as \n 1.Add\n 2.Sub\n 3.Multiply\n 4.Divide \n");

scanf("%d", &ch);

switch(ch)

{

case 1:

c=a+b;

printf("%d", c);

break;

case 2:

d=a-b;

printf("%d", d);

break;

case 3:

e=a*b;

printf("%d", e);

break;

case 4:

f=a/b;

printf("%d", f);

break;

default:

printf("Wrong Input");

break;

}

getch();

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to write a Program to add subtract multiply and divide the two number using switch and case statement?
Write your answer...
Submit
Still have questions?
magnify glass
imp