Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

#include <stdio.h>

int main ( int argc, char* argv [ ] )
{
int value1 = 10;
int value2 = 5;
printf ( "\n The sum is :%d", value1 | value2 );

}
This is the answer asked by some one to add two numbers
with out using arithmetic operator?Yes this answer is write
it given out put as 15.But how?????
what is need of following line?
int main ( int argc, char* argv [ ] )
how it work?what is the meaning for this line?
please explain me.Advance thanks

Answer Posted / deepak

binary value of 10 = 1010
binary value of 5 = 0101

so if u do bitwise OR. u will get 1111, which is the binary
value of 15. Note: This will not work for all the case:
For eg, value1 = 5 and value2 = 5 will not give u 10.
Instead the printf will print 5 only.

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the functions to open and close file in c language?

1260


What does d mean?

1164


What will be your course of action for a push operation?

1154


How can you check to see whether a symbol is defined?

1140


In c programming language, how many parameters can be passed to a function ?

1166


What are types of preprocessor in c?

1112


what do u mean by Direct access files? then can u explain about Direct Access Files?

2145


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

2462


Explain the use of bit fieild.

1198


What is a macro, and explain how do you use it?

1123


What is calloc malloc realloc in c?

1106


What is return type in c?

1189


Why is it usually a bad idea to use gets()? Suggest a workaround.

1868


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2923


Can the size of an array be declared at runtime?

1143