Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main()
  6. {
  7. int size;
  8. int low;
  9. int high;
  10. int flag=0;
  11. int *p;
  12. printf("enter size of array:\n");
  13. scanf("%d",&size);
  14. while (size>=10){
  15. scanf("%d",&size);
  16. }
  17.  
  18. printf("enter the number low:\n");
  19. scanf("%d",&low);
  20. printf("enter the number low:\n");
  21. scanf("%d",&high);
  22. while (flag!=0){
  23. if ((high-low)>=size/2 && (high-low)<size)
  24. flag=1;
  25. else
  26. {
  27. printf("enter the number low:\n");
  28. scanf("%d",&low);
  29. printf("enter the number low:\n");
  30. scanf("%d",&high);
  31. }
  32.  
  33. }
  34.  
  35.  
  36.  
  37. return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement