c program to generate multiplication table

c program to generate multiplication table:

In this program  we understand  how to generate the table form C program by using the For Loop
and print the tables which you want

 

A table of numbers is created by the multipy of number a consistent number with an iterative number from 1 to 10 to get the table. At the end of the day, we can get the table of a number by duplicating the given number with counting from 1, 2, 3, 4, 5, ..., 9, 10. Furthermore, on every emphasis, the benefit of counting is increased by 1, which goes up to 10, to print a total table. 

 
c program to generate multiplication table || iot desgin

Fig= "C program to genrate the table"

Program = 1.

  1. #include <stdio.h>  
  2. #include<conio.h>
  3. Void main()  
  4. {  
  5.     int n, i;                                              // declare a variable  
  6.     printf (" Enter a number which Table you want: ");  
  7.     scanf (" %d", &n);                            // take a  number from the user 
  8.                                                           // use the  for loop to iterate the number from 1 to 10  
  9.     for ( i = 1; i <= 10; i++)  
  10.     {  
  11.         printf ("\n %d * %d = %d", num, i, (num*i));  
  12.     }  
  13.     getch();  
  14. }  


Example:The Answer is 

Enter a number Which Table You Want: 2

2 * 1 = 2

2 * 2 = 4

2 * 3 = 6

2 * 4 = 8

2 * 5 = 10

2 * 6 = 12

2 * 7 = 14

2 * 8 = 16

2 * 9 = 18

2 * 10 = 20














Post a Comment (0)
Previous Post Next Post