What will be the output of the following C code? [code]int ch= ' '; if(isgraph(ch)) printf("ch = %c can be printed \n",ch); else printf("ch=%c

Khang Lê

New member
What will be the output of the following C code?
Code:
int ch= ' ';
if(isgraph(ch))
printf("ch = %c can be printed \n",ch);
else
printf("ch=%c cannot be printed \n",ch);
A. ch = ‘ ‘ can be printed
B. ch = ‘ ‘ cannot be printed
C. compile error
D. run-time error
 
Answer: b
Explanation: void isgraph() function is used to check if the character has graphical representation. Graphical representations character are all those characters that can be printed except for whitespace characters, which is not considered as isgraph characters.
 

Tìm kiếm

Back
Top