forked from mecchmatProjects/CppCourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3.1.c
More file actions
25 lines (24 loc) · 691 Bytes
/
3.1.c
File metadata and controls
25 lines (24 loc) · 691 Bytes
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
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int num;
printf("Enter num: ");
scanf("%d", &num);
int odinits = num % 10;
num /= 10;
int desiatkiv = num % 10;
num /= 10;
int soten = num;
printf("oditins: %d", odinits);
printf("\n");
printf("desiativ: %d", desiatkiv);
printf("\n");
printf("soten: %d", soten);
printf("\n");
printf("sum = %d", odinits+desiatkiv+soten);
printf("\n");
int num2 = odinits * 100 + desiatkiv*10 + soten;
printf("reverse num = %d", num2);
printf("\n");
return 0;
}