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                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
char ch=10;printf("%d",ch);what is the output
 Question Submitted By :: Sandipan
I also faced this Question!!     Rank Answer Posted By  
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 1
10
 
Is This Answer Correct ?    5 Yes 5 No
Suganya
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 2
58
Ascii of '0' is 48
thus, ascii of '10' is 48+10=58
 
Is This Answer Correct ?    3 Yes 5 No
Marc
 
 
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 3
There will be no output
 
 because, in printf statement it is declared in %d
  %d is integer variable
  %s should be declared
 
Is This Answer Correct ?    0 Yes 6 No
Kalpana.y
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 4
answer is 49,a character constant can be one character  
so ch=10----> here  1 is taken as character,in print 
statement it is conv to ascii
 
Is This Answer Correct ?    0 Yes 7 No
Jj
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 5
answer is 49,a character constant can be one character  
so ch=10----> here  1 is taken as character,in print 
statement it is conv to ascii
 
Is This Answer Correct ?    0 Yes 6 No
Jj
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 6
answer is 49,a character constant can be one character  
so ch=10----> here  1 is taken as character,in print 
statement it is conv to ascii
 
Is This Answer Correct ?    0 Yes 4 No
Jj
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 7
output is 

10
 
Is This Answer Correct ?    4 Yes 3 No
Rani
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 8
this program is gonna give output 10.coz ascii values are 
assigned to only 0....9.when we execute printf("%
c",ch);.........the output screen will be blank.
 
Is This Answer Correct ?    1 Yes 2 No
Devvv
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 9
@Devvvv
every character has an ascii value..
it is not that only 0 - 9 has ascii values.. even 10 , 20 
has ascii values.

each and every value has an ascii value..

comming back to the ques:
i think it will give the ascii value of 10...
 
Is This Answer Correct ?    2 Yes 0 No
Shruti
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 10
The output will be 10.

char consists of 1 byte = 8 bits

it can hold any value between 0 - 127
an unsigned char can hold any 0 - 256

the asci value 10 is newline, 
so if u format it as char using %c
printf ( "\n|%c|", ch ); the 10 is converted to new line

otherwise if u format it to int using %d, it ud print 10
 
Is This Answer Correct ?    7 Yes 0 No
Abdur Rab
 
  Re: char ch=10;printf("%d",ch);what is the output
Answer
# 11
it prints the ascii value of 10. inthese case ineger 10 
will occupy only 1 byte.
 
Is This Answer Correct ?    3 Yes 0 No
Vaibhav
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } } ME5
What is the function of ceil(X) defined in math.h do? A)It returns the value rounded down to the next lower integer B)it returns the value rounded up to the next higher integer C)the Next Higher Value D)the next lower value Accenture3
How to implement call back functions ? HP2
Explain the differences between public, protected, private and internal.  1
two variables are added answer is stored on not for third variable how it is possible?  3
What is the diffences between Windows XP and Windows Visa Aricent1
wats the diference btwen constant pointer and pointer to a constant.pls give examples.  6
what is the output of the following program? main() { int c[]={2,8,3,4,4,6,7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf("%d",*c); ++q; } for(j=0;j<5;j++) { printf("%d",*p); ++p; } }  4
CopyBits(x,p,n,y) copy n LSBs from y to x starting LSB at 'p'th position. Adobe4
identify the in correct expression a.a=b=3=4; b.a=b=c=d=0; float a=int b=3.5; d.int a; float b; a=b=3.5; TCS5
whether itis a structured language? Microsoft1
WAP to accept rollno,course name & marks of a student & display grade if total marks is above 200?  2
Which of the following data structures is on average the fastest for retrieving data: 1) Binary Tree 2) Hash Table 3) Stack  3
how to find the size of the data type like int,float without using the sizeof operator?  7
WHAT IS THE DIFFERANCE BITWIN GETS();AND SCANF();  2
WHY DO WE USE A TERMINATOR IN C LANGUAGE?  2
what is the difference between const char *p, char const *p, const char* const p Accenture4
Write one statement equalent to the following two statements x=sqr(a); return(x); Choose from one of the alternatives a.return(sqr(a)); b.printf("sqr(a)"); c.return(a*a*a); d.printf("%d",sqr(a)); TCS4
what are the interview question's in the language c Nipuna1
how can we use static and extern?and where can we use this? Excel3
 
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