in C,how can we convert an infinite loop into finite loop without wrinting anything in syntax of for loop....
#include<stdio.h>
#include<conio.h>
int main()
{
int a;
a=1;
a++;
for( ; ; )
{
a<=10;
printf("%d",a);
}
getch();
}
You could use break statement there.
This will exit the loop and start control beneath the loop body.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With