Advertisement
WadeRollins2710

Random Number Generator

Nov 16th, 2015
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. //Random Number Generator
  2. #include<stdio.h>
  3. #include<time.h>
  4. #include<windows.h>
  5.  
  6. int Max, Min, value;
  7.  
  8. void Start_up( )
  9. {
  10.     printf("Random Number Generator "); Sleep(2000);
  11.     printf("by Tran V.Anh AKA Wade Rollins\n");
  12. }
  13.  
  14. void Input( )
  15. {
  16.     printf("Minium value: ");
  17.     scanf("%d",&Min);
  18.     printf("Maximum value: ");
  19.     scanf("%d", &Max);
  20. }
  21.  
  22. void Processing( )
  23. {
  24.     int Subtract;
  25.     printf("Instant time for random generator: %d\n", time(NULL));
  26.     srand(time(NULL));
  27.     Subtract=Max-Min;
  28.     value=Min+(rand( )%Subtract);
  29. }
  30.  
  31. void Output( )
  32. {
  33.     printf("Value: %d", value);
  34. }
  35.  
  36. int main( )
  37. {
  38.     Start_up( );
  39.     Input( );
  40.     Processing( );
  41.     Output( );
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement