Computer Science, asked by ayush51098, 1 year ago

write a program to print the table of 5 using while loop

Answers

Answered by jefferson7
1

#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() ;

}

Answered by Arslankincsem
3

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

Similar questions