char ch=10;printf("%d",ch);what is the output
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
Answer / marc
58
Ascii of '0' is 48
thus, ascii of '10' is 48+10=58
| Is This Answer Correct ? | 6 Yes | 14 No |
a 'c' program to tell that the set of three coordinates lie on a same line
what is the maximum limit of row and column of a matrix in c programming. in linux .
what is the output of the code and how? main() { int *ptr,x; x=sizeof(ptr); printf("%d",x); }
proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output?
Write down the program to sort the array.
x=2,y=6,z=6 x=y==z; printf(%d",x)
13 Answers Bharat, Cisco, HCL, TCS,
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
1.Why do you call C is middle level language? 2.Why do you call C is userfriendly language.
Write a program to print factorial of given number using recursion?
how to set Nth bit of variable by using MACRO
write a program to find the frequency of a number
Stimulate calculators to perform addition,subtraction,multiplication and division on two numbers using if/else statement?