Monday 22 April 2013

Code to produce decreasing stars

Description:

This program simply produce increasing and decreasing stars automatically.

Code:


#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
    int i,j;
    for(i=5;i>=1;i--){
    for(j=0;j<i;j++)
    {cout<<"*";
    }
    cout<<endl;
}
    getche();
}

 
Output :



No comments:

Post a Comment