Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- struct user
- {
- char name[200];
- char pass[200];
- };
- int main()
- {
- int i, n = 0;
- char N[5];
- gets(N);
- struct user users[100];
- for (int i = 0; ; ++i) {
- if (N[i] == NULL) {
- break;
- } else {
- n = n * 10 + N[i] - '0';
- }
- }
- for(i = 0; i < n; i++)
- {
- printf("your account number is %d :", i + 1);
- printf("\nEnter your name: ");
- gets(users[i].name);
- printf("\nenter your pass: ");
- gets(users[i].pass);
- }
- display(users, n);
- }
- void display(struct user users[], int n)
- {
- int i;
- for(i = 0; i < n; i++)
- {
- printf("\nyour account number is %d :", i + 1);
- printf("\nyour name is %s", users[i].name);
- printf("\nYour password is %s", users[i].pass);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement