Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are to write a short C program what will input two numbers (the numbers will

ID: 3872024 • Letter: Y

Question

You are to write a short C program what will input two numbers (the numbers will come from the user) and then display the following output statements (you are to let C do the math for you):
1. You are to display the product of the numbers.
2. The cube of the second number
3. The remainder of dividing the first number by the second number
4. The result of the first number + the second number * the first number divided by the second number.

For  Example: The user enters a 10 and a 5.
1. The product of 10 times 5 is 50.
2. The cube of 5 is 125.
3. The remainder of dividing 10 by 5 is 0.
4. The last equation result is 20


Explanation / Answer

#include <stdio.h>

int main()
{
int a,b;
printf("Enter a and b values: ");
scanf("%d %d", &a, &b);
printf("The product of %d times %d is %d. ",a,b,(a*b));
printf("The cube of % is %d. ",b,(b*b*b));
printf("The remainder of dividing %d by %d is %d. ",a,b,(a%b));
printf("The last equation result is %d ",(a + b * (a/b)));

return 0;
}

Output:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote