#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

Write a Program to find whether the given number or string is palindrome.

614


How do I determine whether a character is numeric, alphabetic, and so on?

623


about c language

1607


Explain data types & how many data types supported by c?

587


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

571






How does normalization of huge pointer works?

642


What is a list in c?

622


What is double pointer in c?

591


What is identifiers in c with examples?

678


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

2653


What is the most efficient way to store flag values?

690


code for quick sort?

1623


Is a pointer a kind of array?

602


What is a good data structure to use for storing lines of text?

600


What is a stream in c programming?

597