Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. int rozmiar=10;
  5. double funkcja(double x){
  6. double *wsk;
  7. wsk=(double*)malloc(rozmiar*sizeof(double));
  8. double wynik;
  9. wynik=3*(x*x)+5*x-2;
  10. return wynik;
  11. }
  12. int main(int argc, char *argv[]) {
  13. double a[10];
  14. double (*w) (double);
  15. double x;
  16. int i;
  17. srand(time(NULL));
  18. for(i=0;i<rozmiar;i++){
  19. x=rand()%100;
  20. w=funkcja;
  21. a[i++]=(*w) (x);
  22. printf("%.0lf\n", a[i]);
  23. }
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement