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 is the meaning of c in c language?

0 Answers  


Are there namespaces in c?

0 Answers  


write the program to find multiplication of 2-D matrix??????????

1 Answers  


How can you check to see whether a symbol is defined?

0 Answers  


WAP to accept first name,middle name & last name of a student display its initials?

5 Answers   AITH, NIIT,






main() { clrscr(); } clrscr();

6 Answers   ME, Wipro,


What is the need of structure in c?

0 Answers  


Design a program using an array that lists even numbers and odd numbers separately from the 12 numbers supplied by a user.

8 Answers  


what is output of the following statetment?Printf(“%x”, -1<<4); ?

5 Answers  


write aprogram for There is a mobile keypad with numbers 0-9 and alphabets on it. take input of 7 keys and then form a word from the alphabets present on those keys.

1 Answers   iGate, Shashi, Source Bits, Subex,


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

0 Answers  


Is the following code legal? struct a { int x; struct a b; }

4 Answers  


Categories