Could you post what you have come with so far? If I was doing it for the Bottom of the T i would do a for loop to put in the symbol with a while loop nested in it to add the space of half the number provided. Basically your width = oddnumber / 2, then output a blank space that many times then continue the for loop to output the symbol.
Here is a set up that gives the correct output but have no error handling etc. If you notice, your first for loop stays open into the other for which you do not want, you want to break apart the top and bottom, do the top of the T loop then execute the loop for the bottom. Also I used a while loop instead of if/else. On your lower for loop with the if/else what that is doing is putting the space there until it is correct then ends, it does not go all the way down just the first part (if that makes sense).
Here is the way I wrote it
#include <iostream>
usingnamespace std;
int main () {
int number;
int m = 0; //For the while loop to compare to width
char character;
cout << "Enter odd number" << endl;
cin >> number;
cout << " Enter Character" <<endl;
cin >> character;
cout << "\n\n"; //Adds space between input and output
int width = number / 2; //Sets the width to half to make a correct T
for (int n = 0; n < number; n++)
{
cout << character;
}
for (int n = 0; n < number; n++)
{
cout << "\n"; //Skips to the next line
while (m < width)
{
cout << " "; //Adds the whitespace
m++;
}
m = 0; //Set it back to 0 for the next while loop execution
cout << character;
}
return 0;
}
Im sure you can edit and adapt as need be to get what you are looking for and be able to edit it to get what your looking for on the second problem.
Oh I forgot to mention in your code you have: if (j=c)
what this is doing is setting j to whatever value c was, basically the if statement does not compare, if you want it to compare if it equals it do this