Wednesday 16 November 2016

Write a program to display the following format using while loop.


Write a program to display the following format using  while loop.
                                
Solution : 


        #include <iostream.h>
        #include <conio.h>
        #include<iomanip.h> 

        int main ()
        {
              clrscr();
              int i; 
              cout<< "- - - - - - - - - - " << endl 
              cout<< "a                      b"<< endl 
              cout<<  "- - - - - - - - - - " << endl ;

              i ;

              while  (i 5)
             {
                     cout<< i+1 << setw(9<< 5-i <<endl ;
                     i++;
            }

            cout<< "- - - - - - - - - - " << endl ;
            return 0;      
       }


                                                 

1 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...