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

C Programming Language Loop control in C Language (Article) Loop control in C Language (Program)

16924

Program:

// 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.

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.