Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



void main(int argc,char *argv[],char *env[]) { int i; for(i=1;i<argc;i++) printf("%s&quo..

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

void main(int argc,char *argv[],char *env[]) { int i; for(i=1;i<argc;i++) printf("%s&quo..

Answer / msrambabu

i need answer and explation to env function

Is This Answer Correct ?    3 Yes 1 No

void main(int argc,char *argv[],char *env[]) { int i; for(i=1;i<argc;i++) printf("%s&quo..

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

Post New Answer

More C Interview Questions

Why do we use c for the speed of light?

0 Answers  


Why c is procedure oriented?

0 Answers  


What is the restrict keyword in C?

2 Answers  


What is a class c rental property?

0 Answers  


How can you access memory located at a certain address?

0 Answers  


what is the difference between getch() and getchar()?

10 Answers   Huawei, Infosys,


Why is this loop always executing once?

0 Answers  


An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?

0 Answers   Aspire, Infogain,


which of the following go out of the loopo if expn 2 becoming false a.while(expn 1){...if(expn 2)continue;} b.while(!expn 1){if(expn 2)continue;...} c.do{..if(expn 1)continue;..}while(expn 2); d.while(!expn 2){if(expn 1)continue;..}

4 Answers   TCS,


Explain the advantages and disadvantages of macros.

0 Answers   TCS,


What is data structure in c programming?

0 Answers  


what is difference between userlevel threads and kernel level threads ?what are the trades offs between these two approaches ? what approach is most frequently used and why ?

1 Answers  


Categories