what will be the output:
main(){char ch;int a=10;printf("%d",ch);}

Answers were Sorted based on User's Feedback



what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / maruti

answer is some garbage value.
like in my case -53
becaus ch is not beeen initialized.
plz try n execute the programs before posting ur answers

Is This Answer Correct ?    1 Yes 0 No

what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / shruti

it will print the ascii value of the characters..
or some garbage values..

Is This Answer Correct ?    1 Yes 0 No

what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / vignesh1988i

garbage ascii value corresponding to the characterr present
in the memory location ch;

Is This Answer Correct ?    1 Yes 0 No

what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / manjot singh

It will gve a garbage value becoz ch has not value it will
automtically generate value by complier

Is This Answer Correct ?    1 Yes 0 No

what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / amala v

It'll give a warning tat "a is never used...If u Continue
executing...it will the memory address that is currently
used.

Is This Answer Correct ?    1 Yes 0 No

what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / lnk

In the above coding ...
there is a char "ch " assigned with out a value
and a int" a " assigned with a value ...
and it compiles to print a interger (%d) ...
but tries to read a int value fronm ch (which does not
match the data type ) so it gives garbage value .with
compile time warning !

Is This Answer Correct ?    1 Yes 0 No

what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / kalpana.y


There will be no output

because,in printf statement the integer variable is

declared but 'ch' is assinged.it should be 'a' insted
of 'ch'.

Is This Answer Correct ?    5 Yes 5 No

what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / raghu

I think it prints some garbage value. if ch was initialised
then it would have printed the ASCII value of that charecter

Is This Answer Correct ?    0 Yes 0 No

what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / uma

error. you cant get the answer

Is This Answer Correct ?    0 Yes 0 No

what will be the output: main(){char ch;int a=10;printf("%d",ch);}..

Answer / balaji

warning! "a" is assigned a value that is never used

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What is the difference between text files and binary files?

0 Answers  


to write a program, that finds the minimum total number of shelves, including the initial one, required for this loading process. The packets are named A, B, C, D, E …….. Any numbers of packets with these names could be kept in the shelf, as in this example: [ZZLLAAJKRDFDDUUGGYFYYKK]. All packets are to be loaded on cars. The cars are lined in order, so that the packets could be loaded on them. The cars are also named [A, B, C, D, E,………….].

2 Answers   Infosys, TCS,


What is the difference b/w Structure & Union?

3 Answers  


What does the characters “r” and “w” mean when writing programs that will make use of files?

0 Answers  


What is the meaning of ?

0 Answers  






What are enumerated types?

0 Answers  


What is the size of a union variable?

0 Answers  


What are volatile variables?

1 Answers   Mind Tree,


what is ans for this scanf(%%d",c);

1 Answers  


Is this program statement valid? INT = 10.50;

0 Answers  


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

0 Answers  


What is a null string in c?

0 Answers  


Categories