The simplest of all the looping structures in C is the while statement.we have used while in many of our earlier programs.The basic format of the while statement is
while(test condition)
{
body of the loop
}
The while is an entry-controlled loop statement.The test-condition is evaluated and if the condition is true,then the body of the loop is executed.After execution of the body,the test-condition is once again evaluated and if it is true,the body is executed once again.This process of repeated execution of the body continues until the test-condition finally becomes false and the control is transferred out of the loop.On exit,the program continues with the statement immediately after the body of the loop.
The body of the loop may have one or more statements.The braces are needed only if the body contains two or more statements.However,it is a good practice to use braces even if the body has only one statement.
example:
sum=0;
n=1;
while(n<=10)
{
sum=sum+n*n;
n=n+1;
}
printf("sum=%d\n",sum);
Nice blog
ReplyDeleteLove all that you shared. Your blog is amazing. I learn too much from your blog. Your content is very helpful and informative.
ReplyDeletewe also sell best brands Air Conditioners and DC Inverter AC
Thanks for sharing
good article saves this in your future. I hope that you are doing everything possible to allow yourself and make the future bright.
ReplyDeleteBuy Best Abayas in Pakistan
I have read many blogs but this one is very informative. Your content is very informative and helpful, you shared a great blog.
ReplyDeleteplease write more about Air Conditioner
Thanks for sharing
Exceptional great uncommon news, I read your article. I like your undertakings concerning this article on this blog. Your substance is striking you depict all that when everything is said in done.
ReplyDeleteplease write more about Home Appliances
Thanks for sharing
Great article really inspired form it. The article was also well written. If want to buy devices or appliances like this visit the Best Online Shopping Site. You won't regret it.
ReplyDeleteits very informative blog thanks for sharing this kind of information. Also check Apple Stock Price
ReplyDelete