/* Demonstration of nested loops */


main( )
{
 int a, b, s;
          for ( a = 1 ; a <= 3 ; a++ ) /* outer loop */
          {
                    for ( b = 1 ; b <= 2 ; b++ ) /* inner loop */
                    {
                    s= a + b ; printf ( "a = %d b = %d sum= %d\n", a, b, s) ;
                    }
           }
}


0 comments to "NESTING OF LOOPS"

Post a Comment

Powered by Blogger.