GeeksForGeeks - Company Questions - Print Table.c

                                  Print table

Print the table of a given number upto 10. 
Input:
First line contains an integer, the number of test cases 'T'.
Each test case contains a number N whose table is to be printed..

Output:
Print the table of N upto 10.

Constraints: 
1<=T<=100
1<=N<=100

Example:
Input:
1
Output:
9 18 27 36 45 54 63 72 81 90

Solution:

Language: C


#include<stdio.h>
main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n,i;
        scanf("%d",&n);
        for(i=1;i<11;i++)
        printf("%d ",n*i);
        printf("\n");
    }
    
}

Thanks for Visiting, Hope this helps you.... Comments are welcome....

Comments

Popular Posts