Advertisement
Guest User

6.5

a guest
Dec 15th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main() {
  5.  
  6. int x, max;
  7.  
  8. printf("Podaj liczbe x:");
  9. scanf("%d", &x);
  10.  
  11. if(x != -1) {
  12. max = x;
  13. while( x != -1) {
  14. printf("Podaj liczbe x:");
  15. scanf("%d", &x);
  16. if (x> max && x!= -1)
  17. {
  18. max = x;
  19. }
  20.  
  21. }
  22. printf("Max: %d\n", max);
  23. }
  24. else printf("Blad");
  25.  
  26.  
  27. return 0;
  28.  
  29.  
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement