Is there anyone who can help me to make a triangle like this? (Must use if and else statements!)
*
**
***
****
*****
--------------------------------------------------
Can easily do the following:
Code:# include <iostream> using namespace std; int main(){ int row, col; cout << "Enter col"; cin >> col; cout << "Enter row"; cin >> row; char a ='*'; for(int i=1;i<=col;i++){ for(int x<=5;x>i;x--){ cout <<a; } cout <<endl; } system ( "pause"); return 0; }
*
**
***
****
*****
Bookmarks