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

C Program: Loop Control with Continue and Break

The provided C program uses a while loop to print the names of three locations associated with 'Sunbeam'. It includes a 'continue' statement that skips the printing of 'Sunbeam Hinajawadi' when the loop variable 'i' is 1, and a 'break' statement that terminates the loop when 'i' equals 2. The loop iterates while 'i' is less than 5, incrementing 'i' with each 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)
9 views1 page

C Program: Loop Control with Continue and Break

The provided C program uses a while loop to print the names of three locations associated with 'Sunbeam'. It includes a 'continue' statement that skips the printing of 'Sunbeam Hinajawadi' when the loop variable 'i' is 1, and a 'break' statement that terminates the loop when 'i' equals 2. The loop iterates while 'i' is less than 5, incrementing 'i' with each 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>

int main()
{

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

printf("\n Sunbeam Karad");


if(i==1)//1==1 =1
continue;
//continue will skip all the stmt just after it and continue the iterations
//of loop(unlike break )

printf("\n Sunbeam Hinajawadi");


if(i==2)//2==2 => 1
break;
i++;//2
}

You might also like