At the beginning of the program, user will be asked to input two numbers. Then t
ID: 3579685 • Letter: A
Question
At the beginning of the program, user will be asked to input two numbers. Then the two numbers are processed as follows: The first row is the addition of first number and second number. The second row is the subtraction of first number and second number. The third row is the multiplication of first number and second number. The fourth row is the division of first number and second number. The fifth row is the modulus of first number and second number. Please run the EXE file to see the sample program. Print Screen of the Program when Ask User to Input Number Simple Arithmetic Program^^Input first number: 5 Input second number: 3 Print Screen of the Result of the Arithmetic Operation Processing... Addition rightarrow 5 + 3 = 8 Subtraction rightarrow 5 - 3 = 2 Multiplication rightarrow 5 * 3 = 15 Division rightarrow 5/3 = 1 Modulus rightarrow 5/3 = 2 Press any key to continue ...-Explanation / Answer
#include<stdio.h>
int main(void){
int f,s;
printf(" Simple Arithmetic Program ^^ ");
printf("Enter first number : ");
scanf("%d",&f);
printf("Enter second number : ");
scanf("%d",&s);
printf("Processing... ");
printf("Addition -> %d + %d = %d ",f,s,f+s);
printf("Subtraction -> %d - %d = %d ",f,s,f-s);
printf("Multiplication -> %d * %d = %d ",f,s,f*s);
printf("Division -> %d / %d = %d ",f,s,f/s);
printf("Modulus -> %d %% %d = %d ",f,s,f%s);
return 0;
}
/*
sample output
Simple Arithmetic Program ^^
Enter first number : 5
Enter second number : 3
Processing...
Addition -> 5 + 3 = 8
Subtraction -> 5 - 3 = 2
Multiplication -> 5 * 3 = 15
Division -> 5 / 3 = 1
Modulus -> 5 % 3 = 2
*/
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.