Advertisement
dzieciol

Struktury zadanie 1

Dec 17th, 2015
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.62 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     struct osoba{
  7.     char imie[20];
  8.     char nazwisko[20];
  9.     int wiek;
  10.     int pesel;
  11.     };
  12.     struct osoba ad1;
  13. printf("podaj imie  ");
  14. fgets(ad1.imie,20,stdin);
  15. printf("podaj nazwisko  ");
  16. fgets(ad1.nazwisko,20,stdin);
  17.      printf("podaj wiek ");
  18.     scanf("%d",&ad1.wiek);
  19.     printf("podaj pesel ");
  20.     scanf("%d",&ad1.pesel);
  21.         //wyświetlanie
  22.         printf(" imie: %s ",ad1.imie);
  23.         printf("nazwisko: %s ",ad1.nazwisko);
  24.         printf("wiek: %d \n",ad1.wiek);
  25.         printf(" pesel: %d \n",ad1.pesel);
  26.  
  27.  
  28.  
  29.  
  30.  
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement