Computer Science, asked by huziafamd2, 8 days ago

1. Write a program to find the product of any two numbers according to user choice.
2. Write a program to add and subtract of given two numbers, 10 and 5.​

Answers

Answered by kashyhh
0

Answer:

#include<stdio.h>

int main(){

int num1,num2,choice,a,b,c;

printf("enter two numbers");

scanf(%d,&num1);

scanf(%d,&num2);

printf("enter 1 for add\n2 for subtract\n3 for multiplication");

scanf(%d,&choice);

if (choice == 1){

a=num1+num2;

printf(a);

}

else if(choice == 2){

b=num1-num2;

printf(b);

}

else if (choice == 3){

c=num1×num2;

printf(c);

}

else{

printf("wrong command");

}

Similar questions