in Programming in C
3,426 views
2 votes
2 votes

printf(“%c”, 100);

  1. prints 100
  2. prints ASCII equivalent of 100
  3. prints  garbage
  4. None of the above
in Programming in C
3.4k views

2 Answers

2 votes
2 votes
Best answer

Printf("%c",100);

Here %c is a format specifier which prints the ASCII equivalent of the value.

It will Print ASCII value of 100.

But ASCII is not mandated by C Language.

Hence,Option(D)None of these.

edited by

4 Comments

first of all my intension was 2 make u ..understand not argue.

second of all ..u cannot intermix... arjun sir statement and ur statement...wat u said is totally different from arjun sir..and i knw wat arjun said

third of all..."Means it is not mentioned anywhere that ram was the only one in ramayana it can be in mahabharat in the form of krishna."....is true.

   but u cannot relate it to printf statement in c ....so that it can be cout in c++, ///print in python

as it was ram in ramayana & krishna in mahabharta.....

////////printf means "c" language...till now..i think no other language has same printing commanad...yet

fourth of all...accept it...if u committed mistakes..u will grow higher

fifth of all...m sorry if it hearted u...
0
0

Don't take it serious I am just kidding okay laugh and my comment was not on question or any answer i commented on arjun sir comment as they said in their comment " I don't think ASCII is mandated by C language " 

I just commented on it that 

it is not mentioned anywhere that this piece of code anyway related to C language.

because they did not say in question that Consider C-Language to answer this question.

1
1
It prints 'd'. so option B is the correct answer.
0
0
0 votes
0 votes

printf(“%c”, 100);

Prints ASCII value of 100

Option B


Extra stuff:-

printf(“%c”, '100');

Gives warning because 100 are three characters.


printf(“%c”, '1');

Prints 1


printf(“%c”, "1");

error (This is because single quotes are used for char literals, and double quotes are used for string literals)


printf(“%s”, 100);

error


printf(“%s”, '100');

error (This is because single quotes are used for char literals, and double quotes are used for string literals)


printf(“%s”, "100");

Prints 100


 

Answer:

Related questions