while loop in C

 

01 #include<stdio.h>
02
03 int main()
04 {
05 int i=0;
06 while(i!=1)
07 {
08 printf("nYou are inside while loop.");
09 printf("nPress 1 To Exit from loop. : ");
10 scanf("%d",&i);
11 }
12 printf("nYou are out of while loop.");
13 return 0;
14 }
 
 
OUTPUT :


You are inside while loop.
Press 1 To Exit from loop. : 2

You are inside while loop.
Press 1 To Exit from loop. : 3

You are inside while loop.
Press 1 To Exit from loop. : 4

You are inside while loop.
Press 1 To Exit from loop. : 1

You are out of while loop.

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.