Quiz doubt and question 4 and 5 are also in doubt

"/* The output of the following program is ? */ 1) #include
2) using namespace std;
3) int main(){
4) signed CodingBlocks = 9;
5) signed Nagarro = A;
6) signed char HackerBlocks = ‘A’;
7) cout<<CodingBlocks<<endl;
8) cout<<HackerBlocks<<endl;
9) return 0;
} "

in 4th and 5th line how compiler know that it is int or float or char data type ???
why char can be signed and unsigned ??