-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path20240503.c
48 lines (48 loc) · 1.25 KB
/
20240503.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
int main()
{
int k=2;char c='B';
do{
switch(c++)
{
case 'A':
printf("case 'A', k (%d) ", k);
k++;
printf("++ = %d\t", k);
break;
case 'B':
printf("case 'B', k (%d) ", k);
k--;
printf("-- = %d\t", k);
break;
case 'C':
printf("case 'C', k (%d) ", k);
k += 2;
printf(" + 2 = %d\t", k);
break;
case 'D':
printf("case 'D', k (%d) ", k);
k = k%2;
printf("%% 2 = %d\t", k);
continue;
case 'E':
printf("case 'E', k (%d) ", k);
k *= 2;
printf("* 2 = %d\t", k);
break;
default:
printf("default case, k (%d) ", k);
k = k / 3;
printf("/3 = %d\t", k);
}
printf("k (%d) ", k);
k++;
printf("++ = %d\n", k);
printf("C = %c\n", c);
}
while (c <= 'F');
printf("Finally k now %d\n", k);
return 0;
}