DSPS: Print* (pattern)
//============================================================================
// Name : print_pattern.cpp
// Author : Parashar
// Version :
// Copyright : Do not try this at home ;P
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
class star
{
public:
void pattern();
};
void star::pattern()
{
char star='*';
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
cout<<star;
}
cout<<endl;
}
}
int main()
{
cout << "!!!Made by PARASHAR!!!" << endl;
star s;
s.pattern();
return 0;
}
// Name : print_pattern.cpp
// Author : Parashar
// Version :
// Copyright : Do not try this at home ;P
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
class star
{
public:
void pattern();
};
void star::pattern()
{
char star='*';
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
cout<<star;
}
cout<<endl;
}
}
int main()
{
cout << "!!!Made by PARASHAR!!!" << endl;
star s;
s.pattern();
return 0;
}
Comments
Post a Comment