answersLogoWhite

0


Best Answer

1) first you have to find the reverse of an integer..

code is given below,

#include<stdio.h>

void main()

{

int a,b,m,s=0;

printf("enter the value of a");

scanf("%d",&a);

b=a;

while(a!= 0)

{

m=a%10;

s=s*10+m;

a=a/10;

}

if(s == b)

{

printf("original number is equal to the reversed number");

}

else

{

printf("original number is not equal to the reversed number");

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

#include
#include

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

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#include <stdio.h>

#include <conio.h>

{

unsigned long reverse(int);

int n;

clrscr();

Printf("reverse of a given no is:%lu",reverse(n));

getch();

}

unsigned long rev(int x);

{

unsigned long r=0;

while(x>0)

{

r=r*10+(x/10);

x=x/10;

}

return r;

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: A five digit no is entered through the keyboard write a program to obtain the reversed no and to determine whether the original no and reversed no is equal or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

When 25 numbers are entered from the keyboard into an array the number to be searched is entered through the keyboard by user write a program in C to find if number to be searched is present?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int num[25]; int i,j,k=0; for(i=0;i&lt;=24;i++) { printf("Enter numbers : "); scanf("%d",&amp;num[i]); } printf("\nEnter the number to be searched : "); scanf("%d",&amp;j); printf("\nthe is %d",j); for(i=0;i&lt;=24;i++) { if(num[i]%j==0) k=k+1; } printf("\nIt is repeated %d times."k); }


Find the absolute value write a program of a no entered through the keyboard?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; int main () { int num; printf("enter the number"); scanf("%d",&amp;num); if(num&lt;0) num=(-1)*num; printf("absolute value=%d",num); getch(); return 0; }


How can you use a single scanf statement to read in three integers from the keyboard?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; int main(void) { int a,b,c; printf("write three numbers:\n"); scanf("%d %d %d", &amp;a,&amp;b,&amp;c); printf("You entered %d , %d and %d",a,b,c); getch(); }


Check whether the character entered through the keyboard is a lower case alphabet or not by using conditional operater?

# include &lt;stdio.h&gt; # include &lt;conio.h&gt; int main () { char a; printf("Enter the number"); scanf("%c", &amp;a); (a&gt;=97 &amp;&amp; a&lt;=122)? printf("\n\nIt is a lower case alphabet"):printf("\n\nIt is not a lower case alphabet"); getch(); getch();}


What can be entered into spreadsheets?

Three types of data may be entered into a spreadsheet or worksheet: (1) values or numbers, (2) names or labels, and (3) formulas for calculation.

Related questions

Where is ASCII used?

ASCII is used to determine which character to display when a keyboard key is pressed, or code entered.


What displays data as entered?

A computer monitor displays any data that is entered on the keyboard.


How is text usually entered into the word processor?

Typically, text is entered into the word processor from a keyboard.


What data that is entered into a computer?

mouse ,keyboard, joysticks are some examples for input devices


What forms do you need to rescind your child custody and support order?

You need to file for a modification at the court that entered the original order. There will be a hearing on the merits of your request.You need to file for a modification at the court that entered the original order. There will be a hearing on the merits of your request.You need to file for a modification at the court that entered the original order. There will be a hearing on the merits of your request.You need to file for a modification at the court that entered the original order. There will be a hearing on the merits of your request.


What is key entry?

"keyboard entry" refers to: 1. data entered into a computer by a person typing on a keyboard. 2. information received by a computer from a keyboard. This might refer to the data coming into a computer program for example.


What is key board entry?

"keyboard entry" refers to: 1. data entered into a computer by a person typing on a keyboard. 2. information received by a computer from a keyboard. This might refer to the data coming into a computer program for example.


How are formulas entered in excel?

Usually with the keyboard. Just select the cell where you want the formula and type in what you want.


What letter can not be entered by keyboard?

&ntilde;, &oelig;, &sum;, &acute;, &reg;, &dagger;, &yen;, &uuml;, &icirc;, &oslash;, &pi;, ". ', &aring;, &szlig;, &part;, &fnof;, &copy;, &#729;, &#8710;, &#730;, &not;, &Omega;, &asymp;, &ccedil;, &radic;, &int;, &micro;, &le;, &ge;, &divide;, &hellip;, &aelig;, &iexcl;, &trade;, &pound;, &cent;, &infin;, &sect;, &para;, &bull;, &ordf;, &ordm;, -, &ne; are all examples of letters or characters that cannot be entered directly from a standard North American QWERTY keyboard.


What was the heart supposedly weighed against to determine if it entered the afterlife?

The feather of truth


What is eisenhowers first name?

He was born "David Dwight", but was known as Dwight. He reversed the names to "Dwight David" when he entered West Point Military Academy.


What is input in technology mean?

Input is something that can be sent to the computer. An example for an input device would be a keyboard, you type things on the keyboard and that data is input into the computer.