main()
{
int i,j,A;
for(A=-1;A<=1;A++)
prinf("%d\t",!!A);
}

Answers were Sorted based on User's Feedback



main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }..

Answer / kimi

1 0 1

Is This Answer Correct ?    6 Yes 1 No

main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }..

Answer / ashwin kumar

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 ?    5 Yes 0 No

main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }..

Answer / vignesh1988i

1 0 1

Is This Answer Correct ?    2 Yes 0 No

main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }..

Answer / y hussain reddy

1 0 1

Is This Answer Correct ?    1 Yes 0 No

main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }..

Answer / ashwin kumar

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 2 No

main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }..

Answer / mytri

-1 0 1

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More C Interview Questions

i want to have a program to read a string and print the frequency of each character and it should work in turbo c

3 Answers   Persistent, Wipro,


i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

2 Answers  


Explain what is the stack?

0 Answers  


What is infinite loop?

0 Answers  


What are local static variables? How can you use them?

0 Answers  






dynamically allocate memory for linear array of n integers,store some elements in it and find some of them

1 Answers  


What is #line used for?

0 Answers  


a value that does not change during program execution a) variabe b) argument c) parameter d) none

0 Answers  


player is good if the following conditions are satisfied: He is either from “India”, “Japan” or “Korea” He has a minimum of 3 years of experience He has won at least 3 major tournaments, and one of them must be "World Championship Tournament". He must know more than 10 techniques. (but see next question) If he knows less than 10 techniques, then he must be a world champion. His name contains at least 3 words. For example "Sachin Tendulkar" will not meet this condition. Write a method: boolean isGoodPlayer(String name, String country, int yearsExperience, String[] majorTournamentsWon, String[] techniques, boolean isWorldChampion) name country yearsExperience majorTournamentsWon techniques isWorldChampion

1 Answers  


Find the highest of three numbers and print them using ascending orders?

1 Answers  


Write a function in c to find the area of a triangle whose length of three sides is given.

2 Answers  


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

0 Answers   Infosys,


Categories