Program: The break statement


    #include <iostream.h>
    void main()
    {
        int i , j , n = 1 ;
        for(i=1 ; i<5 ;)
        {
            for (j=1 ; ; j++)
            {
                cout<<n<<"  ";
                n++ ;
                if (j >= 5)
                    break;
            }
            i++;
        }
    }

No comments:

Post a Comment