#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 / rahul pradhan

In the printf statement, since the expression uses OR (|),
answer is correct.. 10 and 5 will be converted to its
binary equivalent.
10 = 1010
5 = 0101

10 | 5 1010
0101 gives 1111 which is 15....

Also main function takes only two arguments which
are "argc" and "argv".. thus the arguments are
mentioned...even if u just write main() without arguments,
no problem..

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain spaghetti programming?

794


What is hashing in c?

740


What is c preprocessor mean?

899


How to throw some light on the b tree?

691


How many types of sorting are there in c?

706






What is the best way of making my program efficient?

669


Define Array of pointers.

734


Explain what is the difference between null and nul?

769


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

698


int far *near * p; means

3217


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

1981


What tq means in chat?

702


write a c program for swapping two strings using pointer

2186


What is a pointer on a pointer in c programming language?

723


Why does the call char scanf work?

719