A few days ago
Anonymous

I have a homework on TurboC.?

What is the output in TurboC of the following statements: Note, letter=A

1)Printf (“Letter is: %C”, letter);

2)Printf (“Alpha is \n: %C”, letter);

3)Printf (“I %CM CUTE, % letter);

4)Printf (“\t %C”, letter);

5)Printf (“%C %C %C”, letter, letter, letter

6)Printf (“Letter value is: %d”, letter);

7)Printf (“Answer: %d”, ‘B’-‘A’);

Top 2 Answers
A few days ago
Anonymous

Favorite Answer

You can find out in about 5 seconds if you have the compiler. You do have the compiler, right?

1) Letter is: A

2) Alpha is : A

3) error, no closing quote

4) A

5) A A A

6) Letter value is: 0

(or, above causes datatype error)

7) Answer: 1

1

A few days ago
Anonymous
I believe for 6 you’d actually get the ASCII value of A – 65 – but it’s been awhile since I used printf. As the other poster suggested, there’s nothing like trying them out to see what happens.
1