See what questions your friends are asking today.

If a five digit number is input through the keyboard write a program to calculate the sum of its digits?

View Slide Show

Close
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();
}

More on: Keyboarding

Answer You can do it, it's actually possible. more »
DO IT THIS WAY: Hold Alt and press 253 at the same time. ² OR for laptop users DO IT THIS WAY: Copy and Paste this symbol " ² "... more »

Top Questions

The shift key can be used to make a letter a capital. To do this, you press and hold the...
This is how [===|========> or ………..........(__) …………....…(___) ...
Here are some of the key things to keep in mind with respect to typing posture and hand...

Contributors

«
Hootershooter74
Trust: 176
  • Computers And The Net Supervisor
»

Top Contributors This Week

  • Trust Points: 2199
  • Member Since: 11/11
  • Trust Points: 2720
  • Member Since: 6/07
  • Trust Points: 2333
  • Member Since: 3/09
  • Trust Points: 2925
  • Member Since: 9/07
  • Trust Points: 154
  • Member Since: 4/10