how can i create triangle with c++
#include <iostream> using namespace std; int Rectangle() { int sEdge,lEdge; cout << "short edge: "; cin >> sEdge; cout << "long edge: "; cin >> lEdge; while(lEdge>0) { for(int i=1;i<=sEdge;i++) { cout << '*'; } cout << endl; lEdge-=1; } } int RightTriangle() { int height; cout << "height: "; cin >> height; bool a; while(a) { for (int i=1;i<=height;i++) for(int j=0;j<i;j++) cout << '*'; } cout << endl; height--; } int Equilateraltriangle() { int a,b,height; cout << "height: "; cin >> height; a=height; b=height; while(a>0) for (int i=0;i<a;i++) { cout << " "; } for(int j=0;j<=height;j++) { cout << "*"; } b=b+2; a--; } int Triangle() { int option; cout << "1.Right Triangle\n2.Equilateral triangle\n"; cin >> option; switch(option){ case 1: RightTriangle(); break; case 2: Equilateraltriangle(); break; default: break; } } int main() { bool a=true; while(a){ int select,select2,yselect2; cout << "1.Rectangle\n2.Triangle"; cout << "\noption: "; cin >> select; switch (select){ case 1: Rectangle(); break; case 2: Triangle(); break; default: break; } cout << "1.New Operation\n2.Exit"; cout << "\noption: "; cin >> select2; switch(select2) { case 1: break; case 2: a=false; default: cout << "Incorrect Entry Please Try Again"; cout << "\noption: "; cin >> yselect2; // i want to use switch(select2) with that but doesnt work select2=yselect2; break; } } } this is my code but there are sth wrong with RightTriangle() and Equilateraltriangle() and also i wanted to use switch(select2) after wrong entry how can i fix this.