#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
Write a Program to find whether the given number or string is palindrome.
How do I determine whether a character is numeric, alphabetic, and so on?
about c language
Explain data types & how many data types supported by c?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
How does normalization of huge pointer works?
What is a list in c?
What is double pointer in c?
What is identifiers in c with examples?
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.
What is the most efficient way to store flag values?
code for quick sort?
Is a pointer a kind of array?
What is a good data structure to use for storing lines of text?
What is a stream in c programming?