Wednesday, 16 November 2016

Write the program to display the following output



 Write the program to display the following output : 



Solution: 

      
        #include <iostream.h>


        int main ()
        {
             int i, j , n = 1     

             for(i = 1; i <= 7; i++)
             {
                   for(j =1; j <= i; j++)
                  {
                         cout<< n <<"  "; 
                       n = n + 2 ;
                  }
                 cout<<endl ;
              }
           return 0;
       }




No comments:

Post a Comment

If you have any doubt please let me know

Methods in JAVA Language

 In general, a way may be thanks to perform some task. Similarly, the tactic in Java may be a collection of instructions that performs a sel...