zoi20

Untitled

Jan 14th, 2014
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. struct osoba
  4. {
  5.     char ime[15];
  6.     char prezime[15];
  7.     int telefon;
  8. };
  9. struct osoba unos()
  10. {
  11.     struct osoba *a;
  12.     int i=0;
  13.     printf("unesite ime: ");
  14.     while(a.ime[i]!=' '||a.ime[i]!='\n')
  15.     {
  16.         a.ime[i]=getchar();
  17.         i++;
  18.     }
  19.     a.ime[i-1]='\0';
  20.  
  21.  
  22.    printf("unesite prezime: ");
  23.     while(a.prezime[i]!=' '||a.prezime[i]!='\n')
  24.     {
  25.         a.prezime[i]=getchar();
  26.         i++;
  27.     }
  28.     a.prezime[i-1]='\0';
  29.  
  30.  
  31.    printf("unesite telefon: ");
  32.         scanf("%d",&a.telefon);
  33.  
  34. return a;
  35. }
  36.  
  37.  
  38. int main()
  39. {
  40.     printf("Hello world!\n");
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment