Sunday, 15 December 2013

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;
}

Output

 Enter a number:  3456 
increasing  1  to all digits:   22 

For More Details Please Visit Ictjobs.info

No comments: