#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


Please Help Members By Posting Answers For Below Questions

How can you tell whether two strings are the same?

824


What is wrong with this program statement?

607


What does typeof return in c?

635


if p is a string contained in a string?

1404


What are the types of pointers?

596






What is the difference between procedural and functional programming?

515


Describe the steps to insert data into a singly linked list.

618


Why c is called free form language?

566


Explain what is a pragma?

587


What is pointers in c with example?

575


Is there a built-in function in C that can be used for sorting data?

742


What is the purpose of sprintf() function?

595


What does the function toupper() do?

651


How many main () function we can have in a project?

608


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

4737