Home / Programs / C program to print the multiplication table of 5 from 1 to 10 using do while loop.
Programming Example

C program to print the multiplication table of 5 from 1 to 10 using do while loop.

👁 17,109 Views
💻 Practical Program
📘 Step by Step Learning
This program prints a multiplication table of 5 from 1 to 10. Do-while loop is used in this program. Initially, the value of i is 1. On each iteration, the value of i is increased by 1 and condition i

Program Code

// C program to print the table of 5 from 1 to 10.

#include<stdio.h>
int main()
{
    int i=1;
    do
    {
        printf("5 * %d = %d\n",i,5*i);
        i++;
    }while(i<=10);
    return 0;
}

Output

5 * 1 = 5
5 * 2 = 10
5 * 3 = 15
5 * 4 = 20
5 * 5 = 25
5 * 6 = 30
5 * 7 = 35
5 * 8 = 40
5 * 9 = 45
5 * 10 = 50
Press any key to continue . . .

Explanation

This program prints a multiplication table of 5 from 1 to 10. Do-while loop is used in this program. Initially, the value of i is 1. On each iteration, the value of i is increased by 1 and condition is tested. When the value of i becomes 11,the condition becomes false and loop is terminated.

How to learn from this program

First read the algorithm, then study the program code line by line. After that, compare the code with the output and finally go through the explanation. This approach helps learners understand both the logic and the implementation properly.