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

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();
}
+ 4 others found this useful
Thanks for the feedback!

How do you calculate the sum of all three-digit positive numbers?

The highest 3-digit number is 999. It's the 999th counting number.    The first 99 counting numbers have fewer than 3 digits.    So there are (999 - 99) = 900 positi (MORE)

What to do to write a c program to input a number then a digit and findout the place value of that digit?

include<stdio.h> int main(){ int d,j=1,i,flag=0,count=0,k=0; int b[]; char a[],c; printf("enter the number="); scanf("%s",a); printf("enter the digit="); scanf("%c",& (MORE)

If a 4 digit number is input through the keyboard write a C program to obtain the sum of first and last digit of this number?

include<stdio.h>#include<conio.h>void main(void){int num, a, b, sum;printf(""Please enter a four digit number: "");scanf("%d", &num);a=num/1000; // retrives th (MORE)

A 5 digit positive integer is entered through the keyboard how to write a function in C to calculate sum of digits of the 5 digits number by using recursion and without using recursion?

include <stdio.h> int digit_sum(int); int digit_sum_rec(int); main() { int num; printf("Enter 5 digit positive integer. : "); scanf("%d",&num); printf("The s (MORE)

Write a c program to compute the sum of digits of a given integer number?

int sumDigits(int n) {   int sum = 0;    while( n > 0 ) {   sum += (n % 10); // add last digit of n to sum   n /= 10; // divide n by 10 to "chop off" the last (MORE)
In Italy

5 Types of Italian Keyboards Online

There are many reasons to take a Eurotravel trip to a place like Italy. The culture, food, wine, and breathtaking sights are at the top of the list. However, sometimes you mig (MORE)

Easy to Use Digital Drawing Programs

Digital drawing software provides you with all the tools you need to draw, paint or create graphics. Here are some of the best digital drawing programs available.SketchBook Pr (MORE)

The Best Free Digital Photography Programs

Digital photography programs have made great advances in the past few years. It has gotten to the point where programs you download for free have so many features and tools th (MORE)

Write a C program for sum of two digit numbers by using loop?

include<stdio.h>   void main()   {   int no,rem=0,sum=0,n; /*declaration*/   printf("Enter 2 digit number:");   scanf("%d",&no);   for(n=1;n<3;n (MORE)

C program to find the sum of the digits of a number?

Here You go........... # include<stdio.h># include<conio.h>void main(){int no,sum=0,rem=0;clrscr();printf("\\nEnter a Number: ");scanf("%d",&no);while(no>0) (MORE)

Write a program to find the sum of the digits and reverse of the digits using inheritance?

There is a far easier way to implement the required functionality than using inheritance. However, to answer the question, here's one possible solution that makes use of inher (MORE)