Chapter 2 - Basic of c - Control Structure in c
Chapter 2 - Basic of c - Control Structure in c
D ATA S T R U C T U R E a n d A L G O R I T H M S
return 0;
}
2.3 CONTROL STRUCTURES:
int main()
{
for (int i = 1; i <= 10; i++)
{
printf("Hello World\n");
}
return 0;
}
2.3 CONTROL STRUCTURES:
// Test expression
while(i < 10)
{
// loop body
printf( "Hello World\n");
// update expression
i++;
}
return 0;
}
2.3 CONTROL STRUCTURES:
the break statement is used to terminate the switch and loop statement.
break It transfers the execution to the statement immediately following the loop
or switch.
continue statement skips the remainder body and immediately resets its
continue
condition before reiterating it.