Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


char ch=10;printf("%d",ch);what is the output

Answers were Sorted based on User's Feedback



char ch=10;printf("%d",ch);what is the output..

Answer / abdur rab

The output will be 10.

char consists of 1 byte = 8 bits

it can hold any value between 0 - 127
an unsigned char can hold any 0 - 256

the asci value 10 is newline,
so if u format it as char using %c
printf ( "\n|%c|", ch ); the 10 is converted to new line

otherwise if u format it to int using %d, it ud print 10

Is This Answer Correct ?    18 Yes 1 No

char ch=10;printf("%d",ch);what is the output..

Answer / suganya

10

Is This Answer Correct ?    21 Yes 13 No

char ch=10;printf("%d",ch);what is the output..

Answer / rani

output is

10

Is This Answer Correct ?    10 Yes 5 No

char ch=10;printf("%d",ch);what is the output..

Answer / vaibhav

it prints the ascii value of 10. inthese case ineger 10
will occupy only 1 byte.

Is This Answer Correct ?    3 Yes 0 No

char ch=10;printf("%d",ch);what is the output..

Answer / rogerthatrambo

although i know the answer:
what should be output of this:
do it without running.

int main()
{
char ch='48';
printf("%d %c",ch,ch);
}

Is This Answer Correct ?    1 Yes 0 No

char ch=10;printf("%d",ch);what is the output..

Answer / yash

my output is for
What is output of followingvoid main() [3]
{char ch;for(ch=0;ch<=127;ch)printf("%c %d \n", ch, ch);}

ans: 1024

Is This Answer Correct ?    0 Yes 0 No

char ch=10;printf("%d",ch);what is the output..

Answer / shruti

@Devvvv
every character has an ascii value..
it is not that only 0 - 9 has ascii values.. even 10 , 20
has ascii values.

each and every value has an ascii value..

comming back to the ques:
i think it will give the ascii value of 10...

Is This Answer Correct ?    3 Yes 4 No

char ch=10;printf("%d",ch);what is the output..

Answer / rahul shrivastava

surely ans will be 10.
bcz we are using %d access specifire..if we will use %c then
correnponding symbol of asciii valut 10 will be display(but
is becoms invisible)

Is This Answer Correct ?    0 Yes 1 No

char ch=10;printf("%d",ch);what is the output..

Answer / devvv

this program is gonna give output 10.coz ascii values are
assigned to only 0....9.when we execute printf("%
c",ch);.........the output screen will be blank.

Is This Answer Correct ?    1 Yes 4 No

char ch=10;printf("%d",ch);what is the output..

Answer / marc

58
Ascii of '0' is 48
thus, ascii of '10' is 48+10=58

Is This Answer Correct ?    6 Yes 14 No

Post New Answer

More C Interview Questions

Why shouldn’t I start variable names with underscores?

0 Answers  


Why array starts with index 0

2 Answers  


Who invented bcpl language?

0 Answers  


Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database

2 Answers   TCS, Unisys, Webyog,


What are local static variables? How can you use them?

0 Answers  


Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)

0 Answers   InterGraph,


in b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first a) 6.6/a b) 2*a c) 3*c d) 2/n

1 Answers  


What is the difference between exit() and _exit()?

2 Answers  


if p is a string contained in a string?

0 Answers  


wat is the difference between array and pointer?

4 Answers   Wipro,


What is assignment operator?

0 Answers  


What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25

0 Answers  


Categories