write a program to print the table of 5 using while loop
Answers
#include<stdio.h>
#include<conio.h>
void main()
{
int s, b, z ; //variable declaration
clrscr() ;
s = 1 ;
printf("The multiplication table is :\n\n") ;
do
{
b = 1 ;
do
{
z= s * b ;
printf("%5d", z) ;
b = b+ 1 ;
} while(b <= 10) ;
printf("\n\n") ;
s = s+ 1 ;
} while(s <= 10) ;
getch() ;
}
#include<stdio.h>
void main()
{
int a=1,b,c;
clrscr();
printf("Enter Any Value : ");
scanf("%d",&b);
printf("Table of %d is : ",b);
while(a<=10)
{
c=b*a;
printf(" %d ",c);
a++;
}
getch();
}
This is the program to print the table of 5 by using the while loop function in the C programming language.