FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 46   



Following program shows you how to print table for given number.
In this program we get number from user and print that number table using for loop

#include <stdio.h>
int main() {
    int input;

    printf("Enter the number:");
    scanf("%d", &input);

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

Output:

Enter the number: 6
6 * 1 = 6 
6 * 2 = 12 
6 * 3 = 18 
6 * 4 = 24 
6 * 5 = 30 
6 * 6 = 36 
6 * 7 = 42 
6 * 8 = 48 
6 * 9 = 54 
6 * 10 = 60



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News