Write a program which display upside down isosceles triangle using nested for loop and asterisk character
Output should be look like below image
C++ code:
Sample Output:
More C++ Shapes Here
Output should be look like below image
C++ code:
#include<iostream>
|
Sample Output:
sample output |
More C++ Shapes Here
Can't it be generic ?
ReplyDeleteYes Zainab It can be generic too. Set Variables in For Loops Then Take Input in Variables.
DeleteLike Replace 5 by Variable.
This comment has been removed by the author.
ReplyDeleteYou can also use the code for:
ReplyDelete*****
****
***
**
*
to built an upside down triangle by just putting one space before or after asterisk (i.e cout<<" *" or cout<< "* ") in 3rd for loop.
----------------
ReplyDelete----- *---------
---*****------
----***--------
---*-----*-------
how to do this using C++?
how to print a diamond using a c++ code ? please help!
ReplyDeletewhy do you used a<=5 only in the first for loop..please tell fast
ReplyDeleteMy output is
ReplyDelete*******
*****
***
*
Why?