Write a program to print following triangle. (Use getdata() for get n value & display() for print triangle)
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)
*
* *
* * *
* * * *
* * * * *
# Program Code Here
Note: *Remove the sentence___(Don’t
Missing Syntax Required)
#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();
}
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment