address book - 1. #include <stdio.h> 2. #include...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1. #include <stdio.h> 2. #include <conio.h> 3. #include <string.h> 4. #include <stdlib.h> 5. 6. struct person 7. { 8. char fname[20]; 9. char lname[15]; 10. char address [10]; 11. char telephone[10]; 12. }; 13. 14. char Selection(char choice) 15. { 16. printf("a. Data Entry"); 17. printf("\nb. Search and Edit a Record"); 18. printf("\nc. Search and Delete a Record"); 19. printf("\nd. Display all Records"); 20. printf("\ne. Exit from the program"); 21. printf("\n\nEnter your choice: "); 22. scanf(" %c",&choice); 23. return choice; 24. } 25. 26. int Data_Entry (struct person prson[20], int i) 27. { 28. char fn[20], ln[15], addy[50], tphone[10]; 29. 30. printf("Enter info for student no. %d",i+1); gets("\n"); 31. printf("\nFirst Name: "); gets(fn); 32. strcpy(prson[i].fname, fn); 33. printf("Last Name: "); gets(ln); 34. strcpy(prson[i].lname, ln); 35. printf(" Address : "); gets(addy); 36. strcpy(prson[i]. address , addy); 37. printf("Telephone No.: "); gets(tphone); 38. strcpy(prson[i].telephone, tphone); 39. i++; 40. return i;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/27/2011 for the course COM 285 taught by Professor Randiplante during the Spring '10 term at University of the Philippines Los Baños.

Page1 / 3

address book - 1. #include &lt;stdio.h&gt; 2. #include...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online