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

What does double pointer mean in c?

0 Answers  


Write a program that can show the multiplication table.

0 Answers   Student,


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

0 Answers   Subex,


What is the right type to use for boolean values in c?

0 Answers  


What is size of union in c?

0 Answers  






List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

0 Answers   Ignou,


What is the difference between CV and Resume ?

2 Answers  


What is the size of array float a(10)?

0 Answers  


Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given

0 Answers   XYZ,


Write a code to generate a series where the next element is the sum of last k terms.

0 Answers   Aspiring Minds,


Difference between linking and loading?

0 Answers  


What does d mean?

0 Answers  


Categories