Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

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;
}
Source by www.sanfoundry.com #
 
PREVIOUS NEXT
Tagged: #C #program #Increase #Integer #Digit
ADD COMMENT
Topic
Name
6+9 =