#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
What are the functions to open and close file in c language?
What does d mean?
What will be your course of action for a push operation?
How can you check to see whether a symbol is defined?
In c programming language, how many parameters can be passed to a function ?
What are types of preprocessor in c?
what do u mean by Direct access files? then can u explain about Direct Access Files?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
Explain the use of bit fieild.
What is a macro, and explain how do you use it?
What is calloc malloc realloc in c?
What is return type in c?
Why is it usually a bad idea to use gets()? Suggest a workaround.
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
Can the size of an array be declared at runtime?