Advertisement
Sayukoo

[Tablica]Wypisywanie N elementów

Oct 15th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int n,i,*x;
  4.  
  5. int main()
  6. {
  7.   printf("Podaj Ilosc elementow tablicy ktore chcesz: ");
  8.   scanf("%d",&n);
  9.   x = (int*) malloc (n * sizeof(int));
  10.     for(i=0;i<n;i++)
  11.     {
  12.         printf("%d element tablicy to : ",i+1);
  13.         scanf("%d",&x[i]);
  14.     }
  15.  
  16.  
  17.  
  18.  
  19. for(i=0;i<n;i++)
  20.   printf("\n%d element tablicy to: %d",i+1,x[i]);
  21.  
  22.  
  23.  
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement