Community Sites
Create your own community website and start earning today !
It's Free !
 
Communities Members BookmarksPolls Fresher Jobs Strange Photos Academic Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



C Concept-while LOOP


Posted Date: 12 Jun 2008    Resource Type: Articles/Knowledge Sharing    Category: Computer & Technology

Posted By: Girish Patil       Member Level: Diamond
Rating:     Points: 4



THE while LOOP
Introduction
The while loop is used when you want to repeat the execution of a certain statement or a set of statements (compound statement).

Program/Example
The general format for a while loop is

while (condition)
simple or compound statement (body of the loop)
For example,
i = 0;
while (i<5)
{
printf(" the value of i is %d\n", i);
i = i + 1;
}

Explanation
Before entering into the loop, the while condition is evaluated. If it is true then only the loop body is executed.

Before making an iteration, the while condition is checked. If it is true then the loop body is executed.

It is the responsibility of the programmer to ensure that the condition is false after certain iterations; otherwise, the loop will make infinite iterations and it will not terminate.

The programmer should be aware of the final value of the looping variable. For example, in this case, the final value of the looping variable is 5.

While writing the loop body, you have to be careful to decide whether the loop variable is updated at the start of the body or at the end of the body.





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: C Concept-The switch Statement
Previous Resource: C Concept-do-while LOOP
Return to Discussion Resource Index
Post New Resource
Category: Computer & Technology


Post resources and earn money!
 
Related Resources



Watch TV Channels
  • Watch Asianet TV online
  • Kairali TV in Internet
  • Surya TV online
  • Amritha TV Channel

  • Contact Us    Privacy Policy    Terms Of Use   

    SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.