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 = 0 ;
while (i < 5)
{
cout<< i+1 << setw(9) << 5-i <<endl ;
i++;
}
cout<< "- - - - - - - - - - " << endl ;
return 0;
return 0;
}
Great this program help me a lot
ReplyDelete