Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main () {
  5.  
  6. char command[20];
  7. int rng4Bit = rand() % (15 + 1 - 0) + 0;
  8. long rng8Bit = rand() % (127 + 1 - 0) + 0;
  9. long rng16Bit = rand() % (65535 + 1 - 0) + 0;
  10. long rng32Bit = rand() % (2147483647 + 1 - 0) + 0;
  11. printf("CubeBot is currently functioning, please enter a command \n");
  12. scanf("%s", command);
  13. if (command == ";rng4");
  14. printf("%d", rng4Bit);
  15. else if (command == ";rng8");
  16. printf("%d", rng8Bit);
  17. else if (command == ";rng16");
  18. printf("%d", rng16Bit);
  19. else if (command == ";rng32");
  20. printf("%d", rng32Bit);
  21.  
  22. return 0;
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement