Print sum and product of 2 numbers in C
printf() - Question 9
In this question, we will see how to print the sum and product of 2 integer numbers in C programming using the printf() function. To know more about printf() function click on the printf() function lesson.
Q9) Write a program in C to find the sum and product of 2 integer numbers like int a=5 and b=3.
Program
#include <stdio.h>
#include <conio.h>
int main()
{
int a=5,b=3;
printf("Sum=%d\n",a+b);
printf("Product=%d",a*b);
return 0;
}
Output
Sum=8 Product=15