Advertisement
newb_ie

Untitled

Dec 16th, 2021
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include<stdio.h>
  2. struct user
  3. {
  4. char name[200];
  5. char pass[200];
  6.  
  7. };
  8. int main()
  9. {
  10. int i, n = 0;
  11. char N[5];
  12. gets(N);
  13. struct user users[100];
  14. for (int i = 0; ; ++i) {
  15. if (N[i] == NULL) {
  16. break;
  17. } else {
  18. n = n * 10 + N[i] - '0';
  19. }
  20. }
  21. for(i = 0; i < n; i++)
  22. {
  23. printf("your account number is %d :", i + 1);
  24. printf("\nEnter your name: ");
  25. gets(users[i].name);
  26. printf("\nenter your pass: ");
  27. gets(users[i].pass);
  28. }
  29. display(users, n);
  30.  
  31. }
  32. void display(struct user users[], int n)
  33. {
  34. int i;
  35. for(i = 0; i < n; i++)
  36. {
  37. printf("\nyour account number is %d :", i + 1);
  38. printf("\nyour name is %s", users[i].name);
  39. printf("\nYour password is %s", users[i].pass);
  40.  
  41. }
  42.  
  43. }
  44.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement