Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

#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

What is the function of this pointer?

1345


What is a structure in c language. how to initialise a structure in c?

1067


Explain what is the difference between #include and #include 'file' ?

1027


how to capitalise first letter of each word in a given string?

1929


how to write optimum code to divide a 50 digit number with a 25 digit number??

3270


What is the size of structure pointer in c?

1067


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1126


What is || operator and how does it function in a program?

1093


What is this infamous null pointer, anyway?

1061


What are types of structure?

1121


Explain what is the advantage of a random access file?

1124


Why string is used in c?

1009


What is return in c programming?

973


What is array of structure in c?

1184


What are the types of data files?

1206