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 explanation for prototype function in c?

0 Answers  


what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string

3 Answers  


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

0 Answers   MNC,


main() { int a[10]; printf("%d",*a+1-*a+3); }

2 Answers  


How many levels of pointers have?

0 Answers  






main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); }

9 Answers   TCS,


How to throw some light on the b tree?

0 Answers  


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

0 Answers   Wilco,


What is hash table in c?

0 Answers  


what is ram?

3 Answers   TCS,


why do we use pointer instead directly acessing the data?

2 Answers  


Explain how do you print only part of a string?

0 Answers  


Categories