answersLogoWhite

0


Best Answer

If a five-digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits. For example if the number that is input is 12391 then the output should be displayed as 23402.

//Author::Mudasir Yaqoob.....

#include<stdio.h>

#include<conio.h>

int main()

{

long number,t;

int i=0;

long temp[5];

printf("Enter the five digit number:\n\n");

scanf("%ld",&number);

while(i<=4)

{

t=number%10+1;

temp[i]=t;

number=number/10;

i++;

}

printf("Reverse number\n\n\n\n");

for(i=4;i>=0;i--)

{

printf("%ld",temp[i]);

}

getch();

}

User Avatar

Wiki User

โˆ™ 2011-04-12 03:41:40
This answer is:
User Avatar
Study guides

Add your answer:

Earn +20 pts
Q: If a five digit number is input through the keyboard write a program to calculate the sum of its digits?
Write your answer...
Submit
Still have questions?
magnify glass
imp
People also asked