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 / bharath s

The answer is Garbage value...
The answer willbe lik -113...Depending upon the compailer
If we declare as..
static char ch;
Then Answer is 0.....

Is This Answer Correct ?    21 Yes 0 No

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

Answer / uttama

garbage value will be given

Is This Answer Correct ?    11 Yes 0 No

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

Answer / paul

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

Is This Answer Correct ?    8 Yes 0 No

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

Answer / sadasiva

It gives compilation warning but not Error.
While running ,gives Run time check error and prints some
garbage value.

Is This Answer Correct ?    8 Yes 1 No

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

Answer / anu

I think it will not give any error and it will print some
garbage value.

Is This Answer Correct ?    4 Yes 0 No

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

Answer / raj

It Will print garbage value i.e.
-113

Is This Answer Correct ?    4 Yes 0 No

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

Answer / manju

The answer is garbage value because ch is not initialised

Is This Answer Correct ?    3 Yes 0 No

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

Answer / sirajuddin

variable ch is of character type and nothing is assigned
to it where as 'a' is of interger type.

In the printf statement we are placing variable 'ch' along
with %d which will display a garbage value.

Is This Answer Correct ?    2 Yes 0 No

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

Answer / sulagna samapika

what will be the output of printf("%d")
ans-
the outpot is 0

Is This Answer Correct ?    2 Yes 0 No

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

Answer / viji

it will give some garbage value.........

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Interview Questions

Write a program to print the following series 2 5 11 17 23 31 41 47 59 ...

2 Answers  


an algorithem for the implementation of circular doubly linked list

1 Answers  


what is the different between data structure and data type?

1 Answers   Ignou,


How arrays can be passed to a user defined function

0 Answers  


write a program to rearrange the array such way that all even elements should come first and next come odd

0 Answers  






What does node * mean?

0 Answers  


What is the difference between realloc() and free()

1 Answers  


Every time i run a c-code in editor, getting some runtime error and editor is disposing, even after reinstalling the software what may be the problem?

2 Answers  


How can I invoke another program or command and trap its output?

0 Answers  


int *a[5] refers to

12 Answers   TCS,


How do you define a string?

0 Answers  


for (i <= 5 && i >= -1;++i; i > 0) { printf("%d ", i); }

1 Answers  


Categories