Answers for "C program to Increase 1 to all of the given Integer Digit"

C
0

C program to Increase 1 to all of the given Integer Digit

/*
 * 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;
}
Posted by: Guest on April-23-2022

Code answers related to "C program to Increase 1 to all of the given Integer Digit"

Code answers related to "C"

Browse Popular Code Answers by Language