void main(int argc,char *argv[],char *env[])
{
int i;
for(i=1;i<argc;i++)
printf("%s",env[i]);
}
Answers were Sorted based on User's Feedback
Answer / gaurav
It’s interesting.
This program reads environmental variables. It is as same as
"env" command in unix.
But program is not proper. i.e. if you pass n arguments to
program, then it reads n environmental variables only.
Try this program
void main(int argc,char *argv[],char *env[])
{
int i;
if (2 <=argc){
for(i=0;i<atoi(argv[1]);i++)
printf("\n%s",env[i]);
}else printf("\nPlease enter no. of env variables you want
e.g. 'a.out 5'\n");
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / siddique
void main(int argc, char *argv[], char *env[])
{
int i=0;
while(env[i])
{
printf("%s\n", env[i]);
i++;
}
}
| Is This Answer Correct ? | 2 Yes | 0 No |
sir i got 146 correct question & i have also the advantage of height so will they consider my marks as 146+3=149.can any body tell me how they consider my height marks.
Explain union.
C program to find frequency of each character in a text file?
Method Overloading exist in c ?
What is the significance of scope resolution operator?
0 Answers Agilent, ZS Associates,
code for inverse a matrix
write a program to find the frequency of a number
Can you please explain the difference between malloc() and calloc() function?
Explain what are global variables and explain how do you declare them?
list the no of files created when c source file is compiled
What is a pointer and how it is initialized?
what is the code to display color fonts in the output?