Write a program to display the format by using while loop.
Solution :
#include <iostream.h>
#include <conio.h>
#include<iomanip.h>
int main ()
{
clrscr();
int i , sum = 0 ;
cout<< "- - - - - - - - - - " << endl ;
cout<< "num sum"<< endl ;
cout<< "- - - - - - - - - - " << endl ;
i = 0 ;
while (i < 5)
{
cout<< i+1 << setw(9) << sum<<endl ;
i++ ;
}
cout<< "- - - - - - - - - - " << endl ;
return 0;
return 0;
}
No comments:
Post a Comment
If you have any doubt please let me know