Monday 10 October 2011

10-10-2011 break statment



/*Just an example of break statmenrt.*/

#include <stdio.h>
#include <conio.h>
int main()
{
    int val;
    for(val = 1 ; val <=10 ; val++)
    {
            if (val == 5)
            {
            break;
            }
            printf("%d ",val);
            }
            getche();
            return 0;
   
   
}

/*Output will be the counting from 1 to 4.*/

No comments:

Post a Comment