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 i,j,A;
for(A=-1;A<=1;A++)
prinf("%d\t",!!A);
}
 Question Submitted By :: Raj
I also faced this Question!!     Rank Answer Posted By  
 
  Re: main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }
Answer
# 1
-1    0    1
 
Is This Answer Correct ?    1 Yes 3 No
Mytri
 
  Re: main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }
Answer
# 2
1 0 1
 
Is This Answer Correct ?    4 Yes 1 No
Kimi
 
 
 
  Re: main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }
Answer
# 3
hi friends 

in c we must know one thing 1st

any number other than '0' is taken as false in c language 


so as A=-1 1st
so A is true 
 now not of A  i.e !A = false=0
 now not of !A i.e !!A= true =1

so 1st 1 is printed

same if u do for A=0

it will be false 1st than true than false 

i.e 0 is printed

for A=1 same as A=-1


there fore answer is 101
 
Is This Answer Correct ?    2 Yes 1 No
Ashwin Kumar
 
  Re: main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }
Answer
# 4
sorry friends one small mistake in above explanation 

hi friends 

in c we must know one thing 1st

any number other than '0' is taken as true in c language 


so as A=-1 1st
so A is true 
 now not of A  i.e !A = false=0
 now not of !A i.e !!A= true =1

so 1st 1 is printed

same if u do for A=0

it will be false 1st than true than false 

i.e 0 is printed

for A=1 same as A=-1


there fore answer is 101
 
Is This Answer Correct ?    3 Yes 0 No
Ashwin Kumar
 
  Re: main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }
Answer
# 5
1        0        1
 
Is This Answer Correct ?    2 Yes 0 No
Vignesh1988i
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
write a program to swap Two numbers without using temp variable. HP22
What are the average number of comparisons required to sort 3 elements?  2
what is difference between c and c++  3
i want to know aptitude questions,technical questions  2
#define MAX(x,y) (x) > (y) ? (x) : (y) main() { int i = 10, j = 5, k = 0; k = MAX(i++, ++j); printf("%d %d %d", i,j,k); } what will the values of i , j and k? } NDS9
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.  3
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 are data breakpoints? Adobe1
write a program to find out number of on bits in a number? Huawei12
How would you print out the data in a binary tree, level by level, starting at the top? Microsoft4
To what value do nonglobal variables default? 1) auto 2) register 3) static  4
An interactive c program to read basic salary of 15 persons. each person gets 25% of basic as HRA, 15%of basic as conveyance allowances, 10%of basic as entertainment allowances.The total salary is calculated by adding basic+HRA+CA+EA.Calculate how many out of 15 get salary above 10,000.Rs also print the salary of each employee  2
wap in c to accept a number display the total count of digit  4
main() { clrscr(); } clrscr(); ME3
write a fuction for accepting and replacing lowercase letter to'Z' with out using inline function. Temenos4
Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.  1
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
2. 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 Accenture2
1.write a program to merge the arrays 2.write efficient code for extracting unique elements from a sorted list of array? Qualcomm2
What's the difference between struct x1 { ... }; and typedef struct { ... } x2; ?  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