Search Placementyogi.com
 
3

What is the output of:

main( )
{
int a, b ;
a = -3 - - 3 ;
b = -3 - - ( - 3 ) ;
printf ( "a = %d b = %d", a, b ) ;
}
A.

-3 3

B.

-6 0

C.

0 -6

D.

None of the Above

See Answer & Explanation Lets Discuss
Correct answer is : C
Explanation

-3 - -3= -3 + 3 = 0
-3 --(-3)= -3 - 3 = -6

 

rashmi 9/18/2013 2:15:13 PM
can you explain..it it right hand side exucted first left hand side exuted first....can you explain clarity
vivek 10/12/2013 5:37:08 PM

please explain properly

Pawan Chhipa 2/2/2014 10:50:28 PM

i think the answer is correct i explain :-

we write is in math

   - 3

   - 3

   +                //  when we subtract it then change the sign of last value is become +3

--------------

  0      // then equivalate  it    -3+3=0

same second one is .......

a 7/15/2014 5:30:11 PM

output should be a = 0 b = -6

saket nandan 9/19/2014 2:32:51 PM

increament or decreament is not cosiderd in this question?

Preview

Thanks for posting your comment! It will be visible soon!
Post Another Comment

7
+
4
=

Name:
Email :
Banner to LogicGuns.com

Hide Page Information