fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. int main() {
  6. int A = 0, Num = 312, i = 0;
  7. srand(58);
  8. //Num = (0 + rand() %1000);
  9.  
  10. for (;;) {
  11. printf("enter num\r\n");
  12. scanf("%d\n",&A);
  13. if (A > Num) {
  14. printf("Your number is bigger then %d\r\n", Num);
  15. } else if (A < Num){
  16. printf("Your number is lesser then %d\r\n", Num);
  17. }else if (A == Num){
  18. printf("You win!");
  19. return 0;
  20. }
  21. }
  22.  
  23. }
Success #stdin #stdout 0s 4352KB
stdin
1
400
312
stdout
enter num
Your number is lesser then 312
enter num
Your number is bigger then 312
enter num
You win!