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

Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

0 Answers  


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

0 Answers  


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

0 Answers  


How a string is stored in c?

0 Answers  


let's take a code struct FAQ { int a; char b; float c; double d; int a[10]; }*temp; now explain me how the memory will be allocated for the structure FAQ and what address will be in the structure pointer (temp)....................

8 Answers  






diff .between strcture and union

2 Answers  


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

2 Answers   Cap Gemini, HCL,


what is computer

4 Answers  


WHOT IS CHAR?

4 Answers   TCS,


totally how much header files r in c language

8 Answers   TCS,


how to write a c program to print list of fruits in alpabetical order?

0 Answers  


#define f(x) main() { printf("\n%d",f(2+2)); }

5 Answers  


Categories