Q3. Write a program to accept two numbers from the user and display the output EXACTLY as shown below : [5]
Menu like format showing the operations
Result showing the sum , product , quotient and remainder
1. SUM : …….
2. PRODUCT : …….
3. QUOTIENT :
4. REMAINDER :........
Answers
Answered by
1
Program:
include <stdio.h>
int main() {
int dividend, divisor, quotient, remainder;
printf("Enter dividend: ");
scanf("%d", ÷nd);
printf("Enter divisor: ");
scanf("%d", &divisor);
// Computes quotient
quotient = dividend / divisor;
// Computes remainder
remainder = dividend % divisor;
printf("Quotient = %d\n", quotient);
printf("Remainder = %d", remainder);
return 0;
}
Output :
Enter dividend: 25
Enter divisor: 4
Quotient = 6
Remainder = 1
Similar questions