#include <stdio.h>
#include <stdlib.h>
int main(){
char letter;
printf("Choose your calculation operation:7n/tA:Addition/n/tB:Subtraction/n/tC:Multiplacation/n/tD:Division/n/t");
scanf("%c/n",letter);
float num1, num2;
printf("Enter a Num:");
scanf("%f/n",&num1);
printf("Enter the second Num:");
scanf("%f/n",&num2);
if(letter=='A' || letter=='a') printf("%f + % f = %f",num1,num2,(num1+num2));
else if(letter=='B'||letter=='b') printf("%f - % f = %f",num1,num2,(num1-num2));
else if(letter=='C'||letter=='c') printf("%f * % f = %f",num1,num2,(num1*num2));
else if(letter=='B'||letter=='b') printf("%f / % f = %f",num1,num2,(num1/num2));
else printf("You choosed wrong mark.");
}
質問する
97 次