programming-examples/c/_Basic/C program to Increase 1 to all of the given Integer Digit.c

19 lines
431 B
C
Raw Normal View History

2019-11-15 12:59:38 +01:00
/*
* C program to Increase 1 to all of the given Integer Digit
*/
#include <stdio.h>
int main()
{
int number, sum = 0, remainder, count;
printf("Enter a number: ");
scanf("%d", &number);
while (number)
{
remainder = number % 10;
sum = sum + (remainder + 1);
number /= 10;
}
printf("increasing 1 to all digits: %d", sum);
return 0;
}