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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

766


i want to know the procedure of qualcomm for getting a job through offcampus

1941


Why double pointer is used in c?

568


Why can’t we compare structures?

815


Explain what is the use of a semicolon (;) at the end of every program statement?

738






How can I write functions that take a variable number of arguments?

627


Why do we need a structure?

590


List some applications of c programming language?

553


What are loops c?

616


What is the difference between declaring a variable by constant keyword and #define ing that variable?

2700


How do you view the path?

671


What is a c token and types of c tokens?

592


Explain how can I manipulate strings of multibyte characters?

785


Explain the red-black trees?

610


What is #include called?

570