Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- char is_positive(int i)
- {
- if(i < 0)
- return '-';
- else
- return '+';
- }
- int main(void)
- {
- int x;
- int z;
- printf("Podaj liczbe: ");
- scanf("%d", &x);
- z = is_positive(x);
- printf("Podana liczba ma znak: %c", z);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement