Guest User

Untitled

a guest
Oct 21st, 2015
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4.  
  5. {
  6. int a;
  7. printf("Podaj dowolna liczbe: ");
  8. int czypoprawne = scanf_s("%d", &a);
  9. while (czypoprawne != 1)
  10. {
  11. printf("Podaj poprawny format liczby.");
  12. czypoprawne = scanf_s("%d", &a);
  13. }
  14. if (a > 0)
  15. {
  16. printf("Liczba %d jest dodatnia.\n", a);
  17. printf("Liczba %d nie jest ujemna.\n", a);
  18. }
  19. else if (a < 0)
  20. {
  21. printf("Liczba %d jest ujemna.\n", a);
  22. printf("Liczba %d nie jest dodatnia.\n", a);
  23. }
  24. else
  25. printf("Liczba %d jest zerem.\n", a);
  26.  
  27. system("PAUSE");
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment