1. This program generates a multiplication table for a number provided by the user.
  2. We’ll use a for loop to multiply the number by values from 1 to 10 and print each result.
#include <stdio.h>

int main() {
    int num;

    // Asking user for a number
    printf("Enter a number for the multiplication table: ");
    scanf("%d", &num);

    // Generating the multiplication table
    for (int i = 1; i <= 10; i++) {
        printf("%d x %d = %d\n", num, i, num * i);
    }

    return 0;
}

4 thoughts on “Program to Print Multiplication Table Using for Loop”

Leave a Reply

Your email address will not be published. Required fields are marked *

Verified by MonsterInsights