write a menu driven program to solve the following problem addition subtraction multiplication division exit
Answers
Answered by
0
please rate - thanks I changed yours as little as possible import java.util.*; //used to inlcude scanner public class menuExample { public static void main(String args[]) { //declare a scanner for user Input Scanner userInput = new Scanner(System.in)..
Answered by
0
Answer:
include<stdio.h>
#include<conio.h>
void main()
{
int no1,no2,result;
char choice;
clrscr();
printf("Enter the numbers:");
scanf("%d %d",&no1,&no2);
printf("+.Add\n-.Subtract\n*.Multiply\n/.Divide\n%.Modulus\nEnter your choice:");
choice=getche();
printf("\n");
switch(choice)
{
case '+':result=no1+no2;
printf("Sum= %d",result);
break;
case '-':result=no1-no2;
printf("Difference= %d",result);
break;
case '*':result=no1*no2;
printf("Product= %d",result);
break;
case '/':result=no1/no2;
printf("Quotient= %d",result);
break;
case '%':result=no1%no2;
printf("Remainder= %d",result);
break;
default:printf("Invalid choice");
}
getch();
}
Similar questions
Accountancy,
8 months ago
CBSE BOARD X,
8 months ago
Math,
1 year ago
English,
1 year ago
English,
1 year ago