#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
Which is the best website to learn c programming?
Why we write conio h in c?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
Explain what is wrong in this statement?
What functions are in conio h?
Explain what is a const pointer?
What is difference between array and pointer in c?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
What is difference between union All statement and Union?
Is that possible to add pointers to each other?
I need previous papers of CSC.......plz help out by posting them.......
What are structure members?
Do you know what are bitwise shift operators in c programming?
What is the c value paradox and how is it explained?
What is the use of header?