Table of Contents
Multiply Two Integers Entered by the User using C Program
Pre-requisite Programming concepts
- C Input and Output Operations
- C Operators
Program
#include<stdio.h>
int main()
{
int result,var1,var2;
printf("Enter the values for var1 and var2 \n");
scanf("%d %d",&var1,&var2);
result=var1*var2;
printf("The result is %d \n",result);
return 0;
}
Output
Code Explanation
In this program, the user has to enter two numbers to multiply.
Multiply two numbers using *
operator and store it in a variable using the assignment operator.
Print the output to the console.