mhdew

structure basic

Dec 11th, 2017
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include<stdio.h>
  2.  
  3. struct address{
  4. int house[4];
  5. char area[10];
  6. };
  7. struct add_cont{
  8. char first_name[20];
  9. char last_name[20];
  10. int cell[12];
  11. struct address addr;
  12. };
  13.  
  14. int main()
  15. {
  16. struct add_cont in1[10];
  17. int i, n, p;
  18.  
  19. for(i=1;i<=5;i++){
  20. scanf("%s", in1[i].first_name);
  21. scanf("%s", in1[i].last_name);
  22. scanf("%d", &in1[i].cell);
  23. scanf("%d", &in1[i].addr.house);
  24. scanf("%s", in1[i].addr.area);
  25. //}
  26.  
  27. // printf("Enter the key word\t:");
  28. //scanf("%d", &p);
  29.  
  30. printf("Name\t: %s %s\nCell No\t: %d\nAddress\t: %d %s\n", in1[i].first_name,in1[i].last_name,in1[i].cell,in1[i].addr.house,in1[i].addr.area);
  31. }
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment