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

What is a example of a variable?

0 Answers  


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

0 Answers   Google,


Write a C program to convert an integer into a binary string?

1 Answers  


no consistent academics. how to answer the question

0 Answers  


Are enumerations really portable?

0 Answers  


What is a program?

0 Answers  


how to get starting address of a running C program

3 Answers  


Write a program that can show the multiplication table.

0 Answers   Student,


code for selection sort?

1 Answers  


Explain the difference between #include "..." And #include <...> In c?

0 Answers  


What is the difference between int main and void main in c?

0 Answers  


What is the use of #define preprocessor in c?

0 Answers  


Categories