#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
When should the volatile modifier be used?
What is meant by errors and debugging?
What is main return c?
Is it cc or c in a letter?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
write a program in c language to print your bio-data on the screen by using functions.
Write a program to reverse a given number in c?
Explain the difference between strcpy() and memcpy() function?
why wipro wase
how should functions be apportioned among source files?
When should I declare a function?
How to compare array with pointer in c?
Explain what’s a signal? Explain what do I use signals for?
Why is c so popular?