MIPI_BaseC_WebinarFRTK/03_Lecture03/14_numbers_sum_p32.c

12 lines
178 B
C
Raw Normal View History

2024-11-13 09:22:28 +03:00
#include <stdio.h>
int main()
{
int n=123;
int sum;
sum = n%10; //sum = 3
sum += (n/10)%10; //sum = 5
sum += (n/100)%10; //sum = 6
printf("%d\n",sum);
}