0% found this document useful (0 votes)
26 views1 page

Demo 8

The document contains a C program that demonstrates the use of a nested while loop. The outer loop runs indefinitely, while the inner loop prints three different locations related to 'Sunbeam' and increments a counter. The inner loop is terminated after the first iteration due to a break statement, resulting in only one set of prints per outer loop iteration.

Uploaded by

Arohi Patile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views1 page

Demo 8

The document contains a C program that demonstrates the use of a nested while loop. The outer loop runs indefinitely, while the inner loop prints three different locations related to 'Sunbeam' and increments a counter. The inner loop is terminated after the first iteration due to a break statement, resulting in only one set of prints per outer loop iteration.

Uploaded by

Arohi Patile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

#include<stdio.

h>
//break with nested while loop
int main()
{

//outer for loop


while(1)//1<5 => 1
{
int i=1;
//nested while loop
//inner for loop
while(i<5)
{
printf("\n Sunbeam Pune");

printf("\n Sunbeam Karad");

printf("\n Sunbeam Hinajawadi");


i++;
break;//it would terminate the inner while loop
}
}
}

You might also like