search
Login

Categories


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

3.8k questions

4k answers

117 comments

10.7k users

1 vote
5.6k views
asked 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 Geek 15.7k points 5 9 21
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 Jr Member 630 points 2

Related questions

1 vote
3 answers 3.1K views
3.1K views
C program to find factorial of the given number.
asked Smita Advisor 7.1k points 10 23 42
0 votes
2 answers 743 views
743 views
asked Smita Advisor 7.1k points 10 23 42
2 votes
4 answers 4K views
4K views
c program to check whether the given number is even or odd.
asked Smita Advisor 7.1k points 10 23 42
0 votes
1 answer 3.2K views
3.2K views
asked sara Guru 24.6k points 29 52 81
0 votes
1 answer 54 views
54 views
1 2 1 3 2 1 4 3 2 1 4 3 2 1 3 2 1 2 1 1
asked keem Expert 13.2k points 27 40 59
...