C Books Guide and List
C++ Books Guide and List
Best Java Books

how to display the multiplication table of a given number using C language?.

+1 vote
2,750 views asked Jul 13, 2011 by anonymous

2 Answers

0 votes
 
Best answer
#include <stdio.h>
int main() {
      int num, i = 1;
      printf("\n Enter any Number:");
      scanf("%d", &num);
      printf("Multiplication table of %d: \n", num);
      while (i <= 10) {
            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

Explanation:
We need to multiply the given number (i.e. the number for which we want the multiplication table) with value of 'i' which increments from 1 to 10.
answered Jul 13, 2011 by albertina Geek (15,670 points)
0 votes
#include <stdio.h>
void main()
{
      int n, i = 1;
      printf("\n Enter n Number:");
      scanf("%d", &n);
      printf("Multiplication table of %d", n);
      for(i=1;i<10;i++)
      {   temp=n*i;
            printf("%d*%d = %d", n, i, temp);
            i++;
      }
}
answered Jul 31, 2011 by Anusha Jr Member (630 points)

Related questions

+1 vote
3 answers 912 views
912 views asked Jul 13, 2011 by Smita Advisor (7,140 points)
0 votes
2 answers 620 views
+2 votes
4 answers 1,573 views
1,573 views asked Jul 13, 2011 by Smita Advisor (7,140 points)
0 votes
1 answer 390 views
0 votes
1 answer 16 views
...