Monday, July 27, 2009

C rogram to display the name,address and position of 3 candidates using arrays?

#include %26lt;stdio.h%26gt;


#include %26lt;string.h%26gt;





struct personInfo {


char name[50];


char address[50];


char position[50];


};





void main()


{


struct personInfo personList[3];





strcpy(personList[0].name,"First persons name");


strcpy(personList[1].name,"Second persons name");


strcpy(personList[2].name,"Third persons name");





strcpy(personList[0].address,"First persons address");


strcpy(personList[1].address,"Second persons address");


strcpy(personList[2].address,"Third persons address");





strcpy(personList[0].position,"First persons position");


strcpy(personList[1].position,"Second persons position");


strcpy(personList[2].position,"Third persons position");





for (i=0;i%26lt;3;i++)


{


printf("Name: %s, Address: %s, Position %s\n",personList[i].name, personList[i].address,personList[i].posi...


}





}

C rogram to display the name,address and position of 3 candidates using arrays?
General Research Guides for Students:





http://findarticles.com/





Easy to use links that will help with all your research needs, try typing a keyword or two into the search engine and see what happens.





http://vos.ucsb.edu/index.asp





http://www.aresearchguide.com/





http://www.geocities.com/athens/troy/886...





http://www.studentresearcher.com/search/...





http://www.chacha.com/

brandon flowers

No comments:

Post a Comment