Friday, 11 December 2015

write a program that give the following shape using loop in c++

*****
****
**
*


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

No comments:

Post a Comment