Course Content
Detailed Content of Programming in C
0/1
Introduction
0/1
Structure of C program
0/1
Answers of ‘C’ Pointers Programs
0/1
About Lesson

Print the Multiplication Table using a For Loop.

#include <stdio.h>

int main() {
int num;

// Taking input for the number
printf(“Enter a positive integer: “);
scanf(“%d”, &num);

// Printing the multiplication table for the given number using a for loop
for (int i = 1; i <= 10; i++) {
printf(“%d x %d = %dn”, num, i, num * i);
}

return 0;
}