Thursday 13 September 2007

C coding good questions and answer



C coding good questions and answer



(1) What
will be output of the following code?



#include"stdio.h"

void  main(){

char
a='\\';

clrscr();

a=a-'/';

printf("%d",a);

getch();



}



Output: error



Explanation:

Character is \ has special meaning
in c programming. For example:



‘\0’ represents octal character.

‘\n’ represents new line character.
So we cannot use ‘\’ directly.



(2

No comments:

Post a Comment