Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- int rozmiar=10;
- double funkcja(double x){
- double *wsk;
- wsk=(double*)malloc(rozmiar*sizeof(double));
- double wynik;
- wynik=3*(x*x)+5*x-2;
- return wynik;
- }
- int main(int argc, char *argv[]) {
- double a[10];
- double (*w) (double);
- double x;
- int i;
- srand(time(NULL));
- for(i=0;i<rozmiar;i++){
- x=rand()%100;
- w=funkcja;
- a[i++]=(*w) (x);
- printf("%.0lf\n", a[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement