What is the output of the program?

Main()

{

char a='123'

printf ("%c n",a);

return 0;

}


A. ASCII value of 121

B. 1

C. 3

D. none of these

This question is related to Wipro Interview

Showing Answers 1 - 11 of 11 Answers

sanooj

  • May 7th, 2006
 

ans -D

reason- character constant must be one or two characters long ........therefore an error will be reported.....

divya_419

  • Jun 27th, 2010
 

Answer is 3 (for gcc), whatever may be the i/p you give, whether it is of digits or characters its prints only the last character. If it is a='abc', then it prints c, so answer is 3.

  Was this answer useful?  Yes

akshay

  • May 3rd, 2012
 

The answer is either 3 or its ascii value 51 depending on the compiler.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions