Enter your email address:


Monday, September 2, 2013

Home » , » Write a program to display the multiplica tion table of a given number.

Write a program to display the multiplica tion table of a given number.

Questions: Top-30-c-programs-asked-in-interview_6304.html

20.Write a program to display the multiplica tion table of a given number.
Program: Multiplica tion table of a given number
#include
int main(){
int num, i = 1;
printf("\n Enter any Number:");
scanf("%d" ,&num);
printf("Mu ltiplicati on table of %d: \n", num);
while (i
printf("\n %d x %d = %d", num, i, num * i);
i++;
}
return 0;
}
Output:
Enter any Number:5
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50
Explanatio n:
We need to multiply the given number (i.e. the number for which we want the multiplica tion table)
with value of'i'which increments from 1 to 10.
Share this games :

0 comments:

Post a Comment

Related Posts