quick question how will i go about setting setting up characters to draw a shape such as a triangle. but the user must pick an odd # that equals to the shape .
the one i have is simple but idk how to input the number the user choosen to draw a shape. which is a right triangle or upside right triangle or rectangle or plus sign.
char symbol;
int number;
cout << "draw a triangle " << endl;
cin >> symbol;
cout << " enter an odd number between 3 and 9 to draw shape " << endl;
cin >> number;
i know this is not right
if (number = 3 || 5 || 7 || 9)
{
cout << "you have choosen " << number << endl;
}
}
this is the basic one but my proffessor doesnt want it like this the user must choose a number and then the program will execute the shape.
char symbol;
int number;
cout << "draw a triangle " << endl;
cin >> symbol;
cout << " enter an odd number between 3 and 9 to draw shape " << endl;
cin >> number;
cout << symbol << symbol << symbol << endl;
cout << symbol << symbol << endl;
cout << symbol << endl;
return 0;
if you can point me in the right direction that will be great