write a program to swastika Triangle in C++
• Write a program to print following triangle. (Use getdata() for get n value & display() for print triangle) Get input from user to print n number of line. e.g(n=5) .
*
**
***
****
*****
#include<iostream.h>
#include<conio.h>
class swastik
{
int i,j,k,m,n;
public:
swastikdisp()
{
cout<<"\n\n\t";
for(i=0;i<7;i++)
{
cout<<"*";
}
cout<<endl;
for(j=0;j<6;j++)
{
cout<<"*\t*\n";
}
//cout<<"\n";
for(k=0;k<17;k++)
{
cout<<"*";
}
cout<<endl;
for(n=0;n<6;n++)
{
cout<<"\t*\t*\n";
}
cout<<" ";
for(m=0;m<6;m++)
{
cout<<"*";
}
cout<<"*";
}
};
void main()
{
clrscr();
swastik s;
s.swastikdisp();
getch();
}
Note: *Remove The Sentence on this program ___(Don't Missing Syntax required).
Note: *Remove The Sentence on this program ___(Don't Missing Syntax required).
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment