Search



Saturday, 7 February 2015

Multiply

In this program, int a,b,c statement declares 3 variables named as a,b & c . The 2 values
are entered by user because of scanf statement & stored in a & b . Now, c variable 
stores the multiplication of a & b which is then displayed on screen using printf statement. 
For more information & explanation of this program click here.. 


Program to multiply two numbers.

#include<stdio.h>
#include<conio.h>
void main()
{       int a,b,c;
clrscr();
printf("program to multiply 2 variables");
printf("\n\n enter value of a : ");
scanf("%d",&a);
printf(" enter value of b : ");
scanf("%d",&b);
c = a*b;
printf("after (a*b) ans = %d",c);
getch();
}



No comments:

Post a Comment

Guys if you think something is wrong or should be edit than please do comment.