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
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
How can I pad a string to a known length?
What is meant by realloc()?
What are the string functions? List some string functions available in c.
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
What is data types?
What is storage class?
What is %lu in c?
What is a wrapper function in c?
Why c is called object oriented language?
What is a pointer value and address in c?
develop algorithms to add polynomials (i) in one variable
how to execute a program using if else condition and the output should enter number and the number is odd only...
What are pragmas and what are they good for?