Advertisement

C Program to print table of any number


In this program, You will learn how to print a table of any number in c.


16 Table is : 16 32 48 64 80 96 112 128 144 160

Example: How to to print table of any number in c

#include<stdio.h>

int main() {

   int n, r, i;

   printf("Enter a number:");
   scanf("%d", &n);

   for (i = 1; i <= 10; i++) {
       r = i * n;
       printf("\n%d * %d = %d", n,i,r);
   }

   return 0;
}

Output:

Enter a number:16 

16 * 1 = 16 
16 * 2 = 32                                                                                                                                                         
16 * 3 = 48                                                                                                                                                         
16 * 4 = 64                                                                                                                                                         
16 * 5 = 80                                                                                                                                                         
16 * 6 = 96                                                                                                                                                         
16 * 7 = 112                                                                                                                                                        
16 * 8 = 128                                                                                                                                                        
16 * 9 = 144                                                                                                                                                        
16 * 10 = 160