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

Why c language?

0 Answers  


What do you mean by invalid pointer arithmetic?

0 Answers  


Why structure is used in c?

0 Answers  


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

0 Answers  


write a program structure to find average of given number

1 Answers  


What is difference between constant pointer and constant variable?

0 Answers   Hexaware,


write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]

7 Answers  


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

0 Answers  


explain what is an endless loop?

0 Answers  


When should structures be passed by values or by references?

0 Answers   Adobe,


is it possible to change the default calling convention in c ?

1 Answers   Aptech,


Explain what are the __date__ and __time__ preprocessor commands?

0 Answers  


Categories