Thursday, 5 February 2015

Multiplication of Two Integer Number in C

/*C program to multiply and display the product of two integer numbers entered by user. */

#include <stdio.h>
int main( )
{
    int num1, num2, product;
    printf("Enter two numbers: ");
    scanf("%d %d",&num1,&num2);        /* Stores the two integer numbers entered by user in variable num1 and num2 respectively */
    product = num1*num2;  /* Performs multiplication and stores it */
    printf("Product: %f",product);
    return 0;
}
 
 
Output
Enter two numbers: 2
2
Product: 4

No comments:

Post a Comment