Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int a;
- printf("Podaj dowolna liczbe: ");
- int czypoprawne = scanf_s("%d", &a);
- while (czypoprawne != 1)
- {
- printf("Podaj poprawny format liczby.");
- czypoprawne = scanf_s("%d", &a);
- }
- if (a > 0)
- {
- printf("Liczba %d jest dodatnia.\n", a);
- printf("Liczba %d nie jest ujemna.\n", a);
- }
- else if (a < 0)
- {
- printf("Liczba %d jest ujemna.\n", a);
- printf("Liczba %d nie jest dodatnia.\n", a);
- }
- else
- printf("Liczba %d jest zerem.\n", a);
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment