#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 can you tell whether two strings are the same?
What is wrong with this program statement?
What does typeof return in c?
if p is a string contained in a string?
What are the types of pointers?
What is the difference between procedural and functional programming?
Describe the steps to insert data into a singly linked list.
Why c is called free form language?
Explain what is a pragma?
What is pointers in c with example?
Is there a built-in function in C that can be used for sorting data?
What is the purpose of sprintf() function?
What does the function toupper() do?
How many main () function we can have in a project?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record