#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
Write a program for finding factorial of a number.
What are c preprocessors?
Define circular linked list.
Why doesnt the call scanf work?
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
What is default value of global variable in c?
What are the disadvantages of external storage class?
A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler
Is boolean a datatype in c?
Find MAXIMUM of three distinct integers using a single C statement
What is the newline escape sequence?
What are the types of pointers in c?
What does return 1 means in c?
What is derived datatype in c?
What is the difference between mpi and openmp?