ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
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
 
Is This Answer Correct ?    1 Yes 1 No
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.
 
Is This Answer Correct ?    1 Yes 0 No
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.....
 
Is This Answer Correct ?    2 Yes 0 No
Bharath S
 
  Re: what will be the output: main(){char ch;int a=10;printf("%d",ch);}
Answer
# 4
it will print 64
 
Is This Answer Correct ?    0 Yes 1 No
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
 
Is This Answer Correct ?    0 Yes 1 No
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'.
 
Is This Answer Correct ?    0 Yes 0 No
Kalpana.y
 
  Re: what will be the output: main(){char ch;int a=10;printf("%d",ch);}
Answer
# 7
garbage value will be given
 
Is This Answer Correct ?    0 Yes 0 No
Uttama
 
  Re: what will be the output: main(){char ch;int a=10;printf("%d",ch);}
Answer
# 8
0
 
Is This Answer Correct ?    0 Yes 0 No
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.
 
Is This Answer Correct ?    0 Yes 0 No
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.
 
Is This Answer Correct ?    0 Yes 0 No
Anu
 
  Re: what will be the output: main(){char ch;int a=10;printf("%d",ch);}
Answer
# 11
error
 
Is This Answer Correct ?    0 Yes 0 No
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"......
 
Is This Answer Correct ?    0 Yes 0 No
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
 
Is This Answer Correct ?    0 Yes 0 No
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.
 
Is This Answer Correct ?    0 Yes 0 No
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
 
Is This Answer Correct ?    0 Yes 0 No
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.
 
Is This Answer Correct ?    1 Yes 0 No
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
 
Is This Answer Correct ?    0 Yes 0 No
Raghu
 
  Re: what will be the output: main(){char ch;int a=10;printf("%d",ch);}
Answer
# 18
error. you cant get the answer
 
Is This Answer Correct ?    0 Yes 0 No
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
 
Is This Answer Correct ?    0 Yes 0 No
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.
 
Is This Answer Correct ?    0 Yes 0 No
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
 
Is This Answer Correct ?    0 Yes 0 No
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
 
Is This Answer Correct ?    1 Yes 0 No
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..
 
Is This Answer Correct ?    1 Yes 0 No
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;
 
Is This Answer Correct ?    1 Yes 0 No
Vignesh1988i
 
  Re: what will be the output: main(){char ch;int a=10;printf("%d",ch);}
Answer
# 25
it will give some garbage value.........
 
Is This Answer Correct ?    0 Yes 0 No
Viji
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What is external and internal variables What is dynamic memory allocation what is storage classes in C  2
how to exchnage bits in a byte b7<-->b0 b6<-->b1 b5<-->b2 b4<-->b3 please mail me the code if any one know to rajeshmb4u@gmail.com Honeywell3
what is the difference between <stdio.h> and "stdio.h" Kanbay5
x=2,y=6,z=6 x=y==z; printf(%d",x) HCL7
what is the hexidecimal number of 4100? Google13
what is the advantage of function pointer TCS9
How to write a program for swapping two strings without using 3rd variable and without using string functions. iGate4
Write a program for deleting duplicate elements in an array Subex1
which one is not preprocessor directive a)#if b)#elif c)#undef d)#pragma Wipro11
wap in c to accept a number display the total count of digit  4
Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h" Accenture12
what is c? Tech-Mahindra4
34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?  2
what is differnence b/w macro & functions  1
what is array? HCL6
what is the difference between const char *p, char const *p, const char* const p Accenture3
which types of data structure will i use to convert infix to post fix??? IIT2
what is array?  5
how many header file is in C language ?  3
What is the output of the following program #include<stdio.h> main() { int i=0; fork(); printf("%d",i++); fork(); printf("%d",i++); fork(); wait(); } ADITI2
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com