#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 is the function of volatile in c language?
What are disadvantages of C language.
What is variables in c?
What is d scanf?
What is a void pointer? When is a void pointer used?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
What do you mean by c?
how to introdu5ce my self in serco
What is a macro?
What is type qualifiers?
Explain how do you convert strings to numbers in c?
Is c object oriented?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What is time null in c?
How will you write a code for accessing the length of an array without assigning it to another variable?