#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 / sivakumar
the argc and argv are mentioned in the main as arguments
those are used for the purpose of command line statements.
if we mentioned the main like (argc,argb[]),then that
program can work as command line program. like dos
functions(type,copy....).
Then at that time argc contains count of parameters and argv
contains list of arguments.
eg:-
show_sum 10 20 30
then argc contain value 3 and argv containe list{10,20,30).
ok.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How do you determine whether to use a stream function or a low-level function?
Explain how do you print only part of a string?
Describe the order of precedence with regards to operators in C.
What is a constant and types of constants in c?
What is pointers in c with example?
How many bytes is a struct in c?
Why is c called c?
What is hungarian notation? Is it worthwhile?
In a switch statement, what will happen if a break statement is omitted?
Differentiate between new and malloc(), delete and free() ?
What is type qualifiers?
Can you pass an entire structure to functions?
How can I split up a string into whitespace-separated fields?
How to delete a node from linked list w/o using collectons?
What is #ifdef ? What is its application?