fork(4) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main(void) {
  6. srand(time(NULL)); //only do this once
  7. //for(int i =0;i<25;i++)
  8. {
  9.  
  10. // Why should any programmer need to know that 65 is ASCII for capital A etc?
  11. // printf("%c", (rand()%(90-65))+65); //65 is ASCII for capital A, 90 is ASCII for capital Z
  12.  
  13. // This does not seem to be the English alphabet
  14. printf("There are %d letters in the alphabet.\n", 90 - 65);
  15. printf("There are %d letters in the alphabet.\n", 'Z' - 'A');
  16. printf("No, there are 26 letters in the alphabet.\n");
  17. }
  18.  
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
There are 25 letters in the alphabet.
There are 25 letters in the alphabet.
No, there are 26 letters in the alphabet.