C Programming :: Command Line Arguments - Discussion
Home > C Programming > Command Line Arguments > MCQs Questions Discussion
11 / 15
The following program (HelloProg) is run from the command line as HelloProg 1 2 3. what would be the output ?
#include
void main (int argc, char*argv[])
{
int i,j=0;
for (i=0; i < argc; i++)
j = j + atoi (argv[i]);
printf ("%d",j);
}
void main (int argc, char*argv[])
{
int i,j=0;
for (i=0; i < argc; i++)
j = j + atoi (argv[i]);
printf ("%d",j);
}
A123
BError
C6
D"123"
ENone of these
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
No Discussion on this question yet!