int main() { char ch; do { printf("Hello world\n"); printf("Do you want to print it again?Enter y for yes/n for no.\n"); scanf("%c",&ch); }while(ch=='y'); }
When i run this program it print "Hello world" and "Do you want,,," statements 2 times then ask for entering the choice.... Give me reason why it happens????
Let us talk about the differences between while(1) and while(0) in C language. The while(1) acts as an infinite loop that runs continually until a break statement is explicitly issued. The while(0) loop means that the condition available to us will always be false