News:

Build a stunning handcrafted website with IT Acumens

Main Menu

Infinite loops in C

Started by Shringi, Apr 06, 2010, 08:21 AM

Previous topic - Next topic

Shringi

C language supports a crucial set of infinite loops. These loops are very tricky and easy handleable. just check it out.
Do...While loop
Syntax -
do
{
statements;
while(1);
this loop will regularly work. to stop this loop we should use break keyword with a specific condition.
like..
do
{
printf("Enter any no. and 0 to stop=");
scanf("%d", &n);
if(n==0)
{
break;
}
printf("%d", n*n);
while(1);

johnbrad

whats the output for that...

im trying it but there is error in my programm..