Question

Print Table of 5 using for loop in C Language.

Updated on May 31, 2025 | By Learnzy Admin | πŸ‘οΈ Views: 271 students

Solution
βœ” Verified

This C program prints the multiplication table of 5 using a for loop. The for loop is used to iterate from 1 to 10, and in each iteration, the loop variable is multiplied by 5 to generate the corresponding multiple.

This simple logic helps in understanding how loops work and how arithmetic operations can be combined with control structures in C. The program is a useful example for beginners learning how to generate tables and apply loops effectively in basic programming tasks.

#include <stdio.h>

int main() {
    for (int i = 1; i <= 10; i++) {
        printf("5 x %d = %d\n", i, 5 * i);
    }
    return 0;
}

Output:--

5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
5 x 6 = 30
5 x 7 = 35
5 x 8 = 40
5 x 9 = 45
5 x 10 = 50

Β 

Was this solution helpful? 39
Click here to download practice questions on For Loop In C

More Questions on For Loop In C

Question 1

Print the Alphabet (A to Z) using for loop in C Language


View solution
Question 2

Print a Pattern (Right-Angled Triangle) using for loop in C Language


View solution
Question 3

Calculate factorial of a Number (e.g., 5!) using for loop in C language


View solution
Question 4

Calculate sum of First 10 Natural Numbers using for loop in C Language.


View solution
Question 5

Print Even Numbers from 2 to 20 using for loop in C Language.


View solution
Question 6

Print Numbers from 1 to 10 using for loop in C Language.


View solution