I have to make the letters "T" "O" and "L" using asterisk in c++. The code asks for a size and the letter. This is what I have so far. Honestly I a not great with loops at all, how do i make the loops? some step by step explanation would be appreciated as well. Thanks a ton. Here is my code.
#include<iostream>
using namespace std;
int main()
{
char T, O, L;
char letter;
int number, size;
size = number % 2;
cout << "Welcome to the letter printer." << endl;
cout << "Enter the size : " << endl;
cin >> size;
while (size <= 5 || size == 0)
{
cout << "Invalid size. Enter the size again: ";
cin >> size;
}
cout << "Enter the letter: " << endl;
cin >> letter;
while (letter != 'T' && letter != 'O' && letter != 'L')
{
cout << "Invalid Letter. Enter the letter again:";
cin >> letter;
{
while (letter == 'T')
{
for (int i = 0; i < size; i++)
{
for (int j = 0; j < size; j++)
{
cout << "*";
}
cout << endl;
}
}
}
}