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   To Refer this Site to Your Friends   Click 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
main()
{
    int a = 65;
	printf(“%d %o %x”,a,a,a);
}

Output
65 	101 	41

Please explain me.How it is coming like that?
 Question Submitted By :: Manojkumar
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { int a = 65; printf(“%d %o %x”,a,a,a); } Output 65 101 41 Please explain me.How it is coming like that?
Answer
# 1
It prints the value of in decimal, octal, hexadecimal 
format respectively.
 
Is This Answer Correct ?    3 Yes 0 No
Neha
 
  Re: main() { int a = 65; printf(“%d %o %x”,a,a,a); } Output 65 101 41 Please explain me.How it is coming like that?
Answer
# 2
in octal,divide 65 by 8 and collect the remainder.it will
return 101....and in hexadecimal,divide 65 by 16 and again
collect the remainder...you will get 41......



THANKS
 
Is This Answer Correct ?    2 Yes 1 No
Ruchika Thakur
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What is the meaning When we write "#include" what is # and what does include does there??? HCL11
Which of the following about automatic variables within a function is correct ? a.its type must be declared before using the variable b.they are local c.they are not initialised to zero d.they are global. TCS3
printf("%d",(printf("Hello")); What it returns? TCS23
What is difference between the following 2 lines…. int temp = (int)(0x00); int temp = (0x00int); Bosch3
Given an unsigned integer, find if the number is power of 2?  4
convert 12345 to 54321 withoutusing strig  3
find second largest element in array w/o using sorting techniques? use onle one for loop. Zycus-Infotech2
write a program to sort the elements in a given array in c language  2
main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }  5
main is a predefined or user define function if user defined why? if predefined whay? TCS2
Concat two string with most overlapped substring has to remove  "abcd"+ "cdef" = "abcdef  5
What's a "sequence point"?  2
What is the Difference between Macro and ordinary definition? Motorola2
int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[] Hughes4
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?  3
suppose we use switch statement and we intilize years name using enum statement like(jan,feb,mar,------dec) we take integer value as an input .question is that the month which we analyz is from 0 to 11 bt if i enter 12 than how he again starts from begning and print jan  1
Which of the following is not a valid declaration for main ()? 1) int main() 2) int main(int argc, char *argv[]) 3) They both work  2
Main must be written as a.the first function in the program b.Second function in the program c.Last function in the program d.any where in the program TCS12
how to print a statement in c without use of console statement ,with the help of if statement it should print Satyam2
write an algorithm to get a sentence and reverse it in the following format: input : I am here opuput: Here Am I note: first letter of every word is capiatlised  2
 
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