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   SiteMap shows list of All Categories in this site.
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 x=5;
        printf("%d %d %d\n",x,x<<2,x>>2);
}
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
Answer
# 1
5,3,7
 
Is This Answer Correct ?    1 Yes 2 No
Guest
 
  Re: main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
Answer
# 2
5,20,1
 
Is This Answer Correct ?    5 Yes 1 No
Rahul
 
 
 
  Re: main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
Answer
# 3
5  5
 
Is This Answer Correct ?    0 Yes 1 No
Jignesh Patel
 
  Re: main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
Answer
# 4
5,10,2
 
Is This Answer Correct ?    0 Yes 1 No
Mukul
 
  Re: main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
Answer
# 5
in printf functiton evaluation of variables start from 
right to left so first it evaluates
x>>2
101 after right shift of 2 it will be 001=1
next it will evaluate
x<<2
1 after left shift of 2 it will be 100=4
at the last x=4
so answer is 4 4 1
 
Is This Answer Correct ?    1 Yes 0 No
Anand H I
 
  Re: main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
Answer
# 6
the answer is 0 0 0  ...

thank u
 
Is This Answer Correct ?    0 Yes 0 No
Vignesh1988i
 
  Re: main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); }
Answer
# 7
oh oh , sorry , i didnt see the value of x is 5....


4  4  1

than k u
 
Is This Answer Correct ?    0 Yes 0 No
Vignesh1998i
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?  1
two variables are added answer is stored on not for third variable how it is possible?  3
what does the following function print? func(int i) { if(i%2)return 0; eale return 1; } main() { int =3; i=func(i); i=func(i); printf("%d",i);} TCS8
Which of the following sorts is quickest when sorting the following set: 1 2 3 5 4 1) Quick Sort 2) Bubble Sort 3) Merge Sort  5
Predict the output or error(s) for the following: 25. main() { printf("%p",main); } ME3
main() {int a=200*200/100; printf("%d",a); } TCS7
convert 12345 to 54321 withoutusing strig  3
How can I get Single byte from 'int' type variable? Can we alter single bit or multiple bits in int type variable? if so, How?  2
read the folllowing code # define MAX 100 # define MIN 100 .... .... if(x>MAX) x=1; else if(x<MIN) x=-1; x=50; if the initial value of x=200,what is the vlaue after executing this code? a.200 b.1 c.-1 d.50 TCS2
what information does the header files contain? BSNL5
How to implement call back functions ? HP2
Program to display given 3 integers in ascending order N-Tech1
Evaluate the following: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); 1) 10 2) 11 3) 1  6
What is volatile  2
2. Counting in Lojban, an artificial language developed over the last fourty years, is easier than in most languages The numbers from zero to nine are: 0 no 1 pa 2 re 3 ci 4 vo 5 mk 6 xa 7 ze 8 bi 9 so Larger numbers are created by gluing the digit togather. For Examle 123 is pareci Write a program that reads in a lojban string(representing a no less than or equal to 1,000,000) and output it in numbers. Nagarro2
Write a program which take a integer from user and tell whether the given variable is squar of some number or not. eg: is this number is 1,4,9,16... or not Alcatel8
What will be printed as the result of the operation below: #include<..> int x; int modifyvalue() { return(x+=10); } int changevalue(int x) { return(x+=1); } void main() { int x=10; x++; changevalue(x); x++; modifyvalue(); printf("First output:%d\n",x); x++; changevalue(x); printf("Second output:%d\n",x); modifyvalue(); printf("Third output:%d\n",x); }  2
How do we swap or interchange any 2 numbers without using Temporary variable...Anybody can pls answer it.. Thanks in Advance  7
main() {char a[10]={1,2,3,4,5,6};int x; for(x=0;x<4;x++){ b[x]=x+'a';} printf("%s",b);}  3
enum day = { jan = 1 ,feb=4, april, may} what is the value of may? a)4 b)5 c)6 d)11 e)none of the above HCL2
 
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