Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Zadanie 2. Napisac program wypelniajacy tablice jednowymiarowa o rozmiarze n=50
- liczbami losowymi z przedzialu 0 - 1, a nastepnie wy±wietlic ja na ekranie monitorze.
- */
- #include <stdio.h>
- #include <stdlib.h>./2.
- #include <time.h>
- int main(int argc, char **argv) {
- srand( time(NULL) );
- ;
- int size = 50;
- float tab[size];
- for(int x = 0; x<size; x++) {
- tab[x] = (100+(rand()%899));
- tab[x] /= 1000;
- }
- printf("wylosowane liczby to: \n");
- for(int x = 0; x<size; x++) printf("%d. %.02f\n", x+1, tab[x]);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement