Thursday, May 2, 2013

Write a program that prints the bloc letter B in a 7X6 grid of star

Write a program that prints the bloc letter B in a 7X6 grid of


Algorithn
1  :  Print "***", end of line
2  :  Print"*",setw(4),"*",end of line
3  :  Print"*",stew(4),"*",end of line
4  : Print"***",end off line
5  : Print"*",stew(4),"*",end of line
6  : Print "*",setw(4),"*",end of line
7  : Print"***", end of line
8  : Stop 



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


void main()
{
clrscr();
cout<<"\n***"<<endl;
cout<<"*"<<setw(4)<<"*"<<endl;
cout<<"*"<<setw(4)<<"*"<<endl;
cout<<"***"<<endl;
cout<<"*"<<setw(4)<<"*"<<endl;
cout<<"*"<<setw(4)<<"*"<<endl;
cout<<"***"< endil;
getch();
}


 Out Put 

*****
*      *
*      *
****
*      *
*      *
****


Algorithn
1  :  Print "***", end of line
2  :  Print"*",setw(4),"*",end of line
3  :  Print"*",stew(4),"*",end of line
4  : Print"***",end off line
5  : Print"*",stew(4),"*",end of line
6  : Print "*",setw(4),"*",end of line
7  : Print"***", end of line
8  : Stop







1 comment: