# What is a c program to reverse a five digit number?

#include <iostream>

#include <string>

using std::cin;

using std::cout;

using std::endl;

using std::string;

int main()

{

const int numberOfDig = 5;

string num = "0";

cout << endl << "Enter a five digit number: ";

cin >> num;

string revNum = "00000";

for (int i = 0; i < numberOfDig; i++)

{

revNum[numberOfDig - i - 1] = num[i];

}

cout << endl << "You have entered: " << num

<< endl << "Reversed number is: " << revNum

<< endl;

system("PAUSE");

return 0;

}

OR a much simpler (not perfect) newbie method would be

#include<stdio.h>

#include<conio.h>

int main()

{

clrscr();

int a,b,c,d,e,f,g,i,h;

printf("enter a number");

//i supposed tht given numbers are vwxyz

scanf("%d",&a); //vwxyz

b=a/10000; //v

c=a%10000; //wxyz

d=c/1000; //w

e=c%1000; //xyz

f=e/100; //x

g=e%100; //yz

h=g/10; //y

i=g%10; //z

printf("reversed stuff is %d%d%d%d%d",i,h,f,d,b); //output is zyxwv

getch();

}

### 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]); }…

### What is the difference between the largest five-digit number and the smallest six-digit number?

1 The largest five-digit number is 99999 and the smallest six-digit number is 100000, so the difference is one. If you're just looking for an answer to a homework question, that's all you need. For the brainy: Suppose the answer was greater than one. That would mean that there are one or more numbers between the largest five-digit number and the smallest six-digit number that cannot be written with either five or six digits. Either…

### Five digit number input the keyboard program reverse the number?

#include <iostream> #include <string> using std::cin; using std::cout; using std::endl; using std::string; int main() { const int numberOfDig = 5; string num = "0"; cout << endl << "Enter a five digit number: "; cin >> num; string revNum = "00000"; for (int i = 0; i < numberOfDig; i++) { revNum[numberOfDig - i - 1] = num[i]; } cout << endl << "You have entered: " << num << endl << "Reversed number is…

### Write a program in c language to enter any five digit number and to print the middle digit?

#include <stdio.h> int main(void){ // Local Declerations int intNum; int midDigit; // Statements printf("Enter a 5 digit integral number: "); scanf("%d", &intNum); //the assignment expression below is used to calculate the mid digit oneDigit = (intNum % 1000) / 100; printf("\nThe middle digit is: %d", oneDigit); return 0; }

### Write a five digit number and use c program to obtain the reversed number and to determine if the original and the reversed number were equal or not?

#include<stdio.h> int main() { int original; int original_backup; int backward=0; do { printf("Enter a five digit number, please!"); scanf("%d",&original); } while (original>99999 original < 10000); /*this loop will ask for a new number as long as the user doesn't provide a five-digit one*/ /*note that if you remove it, the program will actually work for any number of digits*/ original_backup = original; /*this will remember the original number for later, as we will destroy it…