Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int switched_a(int a)
- {
- switch (a)
- {
- case 0:
- if (a < 0)
- {
- return 1;
- }
- else{
- return 2;
- }
- break;
- case 1:
- if (a % 2 == 0)
- {
- return 3;
- }
- else {
- return 4;
- }
- break;
- case 2:
- break;
- }
- }
- void output(int a)
- {
- switch (a)
- {
- case 1:
- printf("Число отрицательное");
- break;
- case 2:
- printf("Число положительное");
- break;
- case 3:
- printf("Число четное");
- break;
- case 4:
- printf("Число нечетное");
- }
- }
- int main()
- {
- int a = 54, k = 0, n = 0;
- output(switched_a(n));
- return 0;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement