• Post author:
  • Reading time:1 mins read
  • Post category:C Programs

Multiply Two Integers Entered by the User using C Program

Pre-requisite Programming concepts

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

C program to multiply two integers

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.