Tuesday, 30 July 2013

Chapter 3 solutions Problem [E][h]

Question-Write a program to print the multiplication table of the
number entered by the user. The table should get displayed in
the following form.
29 * 1 = 29
29 * 2 = 58

Solution-

An easy one.Here is the solution of this problem.

#include<stdio.h>
int main()
{
int n,i,ans;
printf("Enter any number\n");
scanf("%d",&n);
for(i=1;i<=10;i++)
{
ans=n*i;
printf("%d*%d=%d\n",n,i,ans);
}
return 0;
}

No comments:

Post a Comment