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.

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

All Comments

Collapse -

This question is releated to C Langauge

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

Don't quite know what you want to know. You've left a semi-colon off after char a='\101'; Also, if you're trying to store the character with ascii value 101 in a just do char a=101; You also don't need conio.h for what you're doing atm. Here is the correct program:

#include <stdio.h>

void main()
{
char a=101;
printf("%c", a);
}

Hope this helps.

Collapse -

This question is releated to C Langauge

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

Your answer is not right I am not agree with your answer

Collapse -

This question is releated to C Langauge

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

Your answer is not right I am not agree with your answer

Collapse -

This question is releated to C Langauge

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

What exactly do you want to know? What do you think is wrong with my answer?

Collapse -

This question is releated to C Langauge

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

I want to know about the answer of the program is given in the question and how it is comming it is not as normal as you are thinking. if i write a='\101' and a=101 these two statement is not same and you are saying it same. This I know a=101 is consider ascii value. But do not know what is in a when I write a='\101'

Collapse -

This question is releated to C Langauge

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

When you specify a value starting with a slash, that's an octal (base number.
Octal 101 = 'A'.

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
8 total posts (Page 1 of 1)  

Related Discussions

Related Forums