Assignment # 02
Object Oriented Programming
Program Code:
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{int x,y;
for(int
x=5;x>=0;x--){
for(int
y=0;y<x;y++)
{
cout<<"*";
}
cout<<endl;
}
getche
();
}
Output:

Program Code:
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int x,y;
for(int x=5; x>=0;
x--)
{
for(int z=5;
z>x; z--)
{
cout<<" ";
}
for(int z=1; z<=x;
z++)
{
cout<<"*";
}
cout<<endl<<endl;
}
getche();
}
0 comments:
Post a Comment