add new file l6.c
This commit is contained in:
parent
eddf38798a
commit
d334435628
1 changed files with 12 additions and 0 deletions
12
c/l6.c
Normal file
12
c/l6.c
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int pol;
|
||||
printf("Enter number ");
|
||||
scanf("%d", &pol);
|
||||
int x1 = pol % 10;
|
||||
int x2 = (pol / 10) % 10;
|
||||
int x3 = ((pol / 10) / 10) % 10;
|
||||
int sum = x1+x2+x3;
|
||||
printf("%d\n", sum);
|
||||
}
|
||||
Loading…
Reference in a new issue