General discussion

Locked

This question is releated to C Langauge

By ms_saini3302 ·
What is the answer of the following and how it is comming:-

#include<conio.h>
#include<stdio.h>
main()
{
char a='\101'
printf("%c",a);
}

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

This question is releated to C Langauge

by bigbox In reply to This question is releated ...

Maybe it's a "slip of the pen", but you forgot a semocolon after the definition of "a" variable.
I think, symbol with code decimal "101" will be printed. :)

Collapse -

This question is releated to C Langauge

by ms_saini3302 In reply to This question is releated ...

This not slip of pen

Collapse -

This question is releated to C Langauge

by Gary_W In reply to This question is releated ...

When you prefix a number with a backslash, that means it's an octal (base value.
Octal 101 = 'A'

Collapse -

This question is releated to C Langauge

by ms_saini3302 In reply to This question is releated ...

Thanks to tell me about this

Collapse -

This question is releated to C Langauge

by xorex In reply to This question is releated ...

if correct:

#include<conio.h>
#include<stdio.h>
main()
{
char a='\101' ; <- must be symbol ';'
printf("%c",a);
}

then will be printed 'A' - symbol with hex code 0x65

Collapse -

This question is releated to C Langauge

by ms_saini3302 In reply to This question is releated ...

Poster rated this answer

Collapse -

This question is releated to C Langauge

by ms_saini3302 In reply to This question is releated ...

This question was closed by the author

Back to Web Development Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums