Tuesday, April 14, 2020

Do while loop in C

do
{
    Statement; 

}while(condition test);
  • Program :
#include<stdio.h>
#include<conio.h>
void main ()
{
   int n,time;
   clrscr();
   printf("\n----------------DO WHILE LOOP----------------");
   printf("\nEnter n and time value :");
   scanf("%d%d",&n,&time);
   do
   {
       printf("\n n = %d",n);
       n = n + 1;
   }while(n<=time);
   getch();
}

  • Output :




No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...