C Programming Code Examples C > Miscellaneous Code Examples C Program to Add digits of the number using single statement C Program to Add digits of the number using single statement In "For Loop" Condition is first tested and then body is executed. Carefully Look at Semicolon at the end of 'For Loop' , which tells us two Things For Loop is Bodyless. Only Condition and Increment Statements will be executed. #include<stdio.h> int main() { int number = 24068; int sum = 0; for (; number > 0; sum += number % 10, number /= 10); printf("\nSum of the Digits : %d", sum); }