Facebook
From Reliable Parrot, 8 Years ago, written in C.
Embed
Download Paste or View Raw
Hits: 388
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. void wypelnij(int *wsk, int n);
  6.  
  7. int main()
  8. {
  9.  
  10.     int n;
  11.     int tablica[20];
  12.  
  13.     printf("Podaj ile poteg liczby 3 chcesz dodac do tablicy(liczac od 0)? \n");
  14.     scanf("%d", &n);
  15.  
  16.     wypelnij(tablica, n);
  17.  
  18.     return 0;
  19.  
  20. }
  21.  
  22. void wypelnij(int *wsk, int n)
  23. {
  24.  
  25.     int i;
  26.  
  27.     for(i = 0; i < n; i++)
  28.     {
  29.         wsk[i]=pow(3,i);
  30.     }
  31.  
  32.     for(i = 0; i < n; i++)
  33.     {
  34.         printf("3 do potegi %d wynosi %d \n", i, wsk[i]);
  35.     }
  36.  
  37.  
  38. }
  39.