Question
what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Question Submitted By :: Sandipan
I also faced this Question!!
Rank
Answer Posted By
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 1
ans ch=0
if we print a it wil be 10
Reddy
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 2
It'll give a warnin tat "a is never used...If u Continue
executing...it will the memory addres that is currently
used.
Paul
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 3
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.....
Bharath S
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 4
it will print 64
Ruth
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 5
error will be occur because a is not in use in output
statement
A.dinesh Kumar
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 6
There will be no output
because,in printf statement the integer variable is
declared but 'ch' is assinged.it should be 'a' insted
of 'ch'.
Kalpana.y
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 7
garbage value will be given
Uttama
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 8
0
Siraj
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 9
It gives compilation warning but not Error.
While running ,gives Run time check error and prints some
garbage value.
Sadasiva
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 10
I think it will not give any error and it will print some
garbage value.
Anu
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 11
error
Sabari
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 12
it will give a warning " that a is assigned a value that is
never used"......
Ranjani
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 13
It Will print garbage value i.e.
-113
Raj
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 14
The correct and verified answer is 8.
Manju
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 15
The answer is garbage value because ch is not initialised
Manju
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 16
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.
Sirajuddin
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 17
I think it prints some garbage value. if ch was initialised
then it would have printed the ASCII value of that charecter
Raghu
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 18
error. you cant get the answer
Uma
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 19
warning! "a" is assigned a value that is never used
Balaji
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 20
I think this program produce some garbage value.
Kanmani
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 21
what will be the output of printf("%d")
ans-
the outpot is 0
Sulagna Samapika
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 22
answer is some garbage value.
like in my case -53
becaus ch is not beeen initialized.
plz try n execute the programs before posting ur answers
Maruti
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 23
it will print the ascii value of the characters..
or some garbage values..
Shruti
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 24
garbage ascii value corresponding to the characterr present
in the memory location ch;
Vignesh1988i
Re: what will be the output:
main(){char ch;int a=10;printf("%d",ch);}
Answer
# 25
it will give some garbage value.........
Viji