SHARE
TWEET

Untitled

Bisus Oct 22nd, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, const char *argv[])
  5. {
  6.     FILE *output;
  7.     int i;
  8.  
  9.     if(argc!=3)
  10.     {
  11.         fprintf(stderr, "Usage: %s name_of_output_file amount_of_elements\n", argv[0]);
  12.         return -1;
  13.     }
  14.  
  15.     output = fopen(argv[1], "w");
  16.  
  17.     for(i = 0; i<atoi(argv[2]); i++)
  18.     {
  19.         fprintf(output, "%d\n", rand());
  20.     }
  21.  
  22.     return 0;
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top