Blog Moved

This website completely moved to new domain. For latest content, visit www.programmingposts.com

Search This Blog

21 Jul 2012

c program to get the product of two numbers

c program to calculate the product of two numbers:

PROGRAM:
#include<stdio.h>
int main()
{
     int x,y;
     int result;
     printf("\n Enter the first number : ");
     scanf("%d",&x);  /* reading 1st number from user*/
     printf("\n Enter the second number: ");
     scanf("%d",&y);  /* reading 2nd number from user*/
     result = x * y;    /* storing the product in result*/
     printf("\n The product of two numbers is: %d \n",result);
     return 0;
}

Sample Output:  ( using GNU GCC Compiler with Code Blocks IDE )

Enter the first number  : 5
Enter the second number: 5
The product of two numbers is: 25

For C# program :  C# PROGARM TO GET PRODUCT OF TWO NUMBERS

1 comment: