Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- float num1,num2;
- int choice;
- printf("Enter 1st Number: ");
- scanf("%f",&num1);
- printf("Enter 2nd Number: ");
- scanf("%f",&num2);
- printf("1.sum 2.difference 3.product 4.subtraction\n");
- printf("Please select: ");
- scanf("%d",&choice);
- if(choice==1) printf("%f",num1+num2);
- else if(choice==2) printf("%f",num1-num2);
- else if(choice==3) printf("%f",num1*num2);
- else if(choice==4) printf("%f",num1/num2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement