Sunday, 20 May 2012

Define break, continue, and scanf().


break
     We often come across situation where we want to jump out of a loop instantly, without waiting to get back to the conditional test. The keyword break allows us to do this. When break is encountered inside any loop, control automatically passes to the first statement after the loop. A break is usually associated with an if.

continue
       In some programming situation, we want to take the control to the beginning of the loop, by passing the statements inside the loop, which has not yet been executed. The keyword continue allows us to do this. When continue is encountered inside any loop, control automatically passes to the beginning of the loop. A continue is usually associated with an if.

scanf()
       scanf() is a function to receive the value from the keyboard by the user. The ampersand (&) before the variables in the scanf() function is a must, & is an ‘Address of’ operator. It gives the location number used by the variable in memory. A blank, a tab or a new line must separate the value supplied to scanf().

No comments:

Post a Comment