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
what is the output of the following code?
main()
{
int I;
I=0x10+010+10;
printf("x=%x",I);
}
give detailed reason
 Question Submitted By :: Vikram
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason
Answer
# 1
12
 
Is This Answer Correct ?    0 Yes 5 No
Arpita
 
  Re: what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason
Answer
# 2
Output of this program is 22
reason is :
0x10 is hexadecimal value  which is equal to 16 in decimal.
010 is octal value which is equal to 8 in decimal
10 is decimal value 

so total is 16+8+10= 34

I value is 34.
Now we are printing the value of I on hexadecimal using %x
34 is equal to 0x22 in hexadecimal.

so the output is 22 in hexadecimal

Hope its is clear to you
 
Is This Answer Correct ?    4 Yes 1 No
Yogesh Bansal
 
 
 
  Re: what is the output of the following code? main() { int I; I=0x10+010+10; printf("x=%x",I); } give detailed reason
Answer
# 3
Output of this program is 22
reason is :
0x10 is hexadecimal value  which is equal to 16 in decimal.
010 is octal value which is equal to 8 in decimal
10 is decimal value 

so total is 16+8+10= 34

I value is 34.

Note:The person above me has given the corrst infm however the output is 34.
Try and run the program in C Compiler
 
Is This Answer Correct ?    1 Yes 1 No
Kartik
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Which of the Following will define a type NODE that is a node in a Linked list? A)struct node {NODE*next;int x;};type def struct node NODE; B)typedef struct NODE {struct NODE *next;int x;}; C)typedef struct NODE {NODE *next;int x;}; D)typedef struct {NODE *next;int x;}NODE; Accenture4
Is main() function predfined or userdefined?  7
create an SINGLE LINKED LISTS and reverse the data in the lists completely  3
a number is perfect if it is equal to the sum of its proper divisor.. 6 is perfect number coz its proper divisors are 1,2 and three.. and 1+2+3=6... a number is deficient if the sum of its proper divisor is less than the number.. sample: 8 is deficient, coz its proper divisors are 1,2 and 4, and 1+2+4=7. abundant number, if the sum of its proper divisor is greater than the number.. sample..12 is abundant coz 1+2+3+4+6=16 which is geater than 12. now write a program that prompts the user for a number, then determines whether the number is perfect,deficient and abundant..  1
Give a fast way to multiply a number by 7 Microsoft8
what is op? for(c=0;c=1000;c++) printf("%c",c); Trigent18
i want explaination about the program and its stack reprasetaion fibbo(int n) { if(n==1 or n==0) return n; else return fibbo(n-1)+fibbo(n-2); } main() { fibbo(6); }  2
How can we see the Expanded source code and compiled code for our source program in C?  1
What's the best way to declare and define global variables?  5
Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use two nested loops. TCS5
If we have an array of Interger values, find out a sub array which has a maximum value of the array and start and end positions of the array..The sub array must be contiguious. Take the start add to be 4000. For Ex if we have an array arr[] = {-1,-2,-5,9,4,3,-6,8,7,6,5,-3} here the sub array of max would be {8,7,6,5} coz the sum of max contiguous array is 8+7+6+5 = 26.The start and end position is 4014(8) and 4020(5). Microsoft4
How do we swap or interchange any 2 numbers without using Temporary variable...Anybody can pls answer it.. Thanks in Advance  7
what is differnence b/w macro & functions  1
How does C++ help with the tradeoff of safety vs. usability?  1
wt is d full form of c Wipro1
Can I pass constant values to functions which accept structure arguments?  2
what is array? HCL22
What is true about the following C Functions a.Need not return any value b.Should always return an integer c.Should always return a float d.Should always return more than one value. TCS7
dibakar & vekatesh..uttejana here..abt ur reply for in place reversal of linked list..wats p stands for there?  1
write a program to arrange the contents of a 1D array in ascending order  3
 
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