write a program that input four digit no and finds it is
palindrome or not
Answers were Sorted based on User's Feedback
#include<stdio.h>
#include<conio.h>
void main()
{
int n,rev=0,rem, temp,i;
printf(" Enter the 4 digit number :\n");
scanf("%d", &n);
temp = n;
for(i=1;i<=4;i++)
{
rem = n % 10;
n = n/10;
rev = rev * 10 + rem;
}
if(temp == rev)
printf(" Its a palindrome:\n");
else
printf(" Not a palindrome:\n");
getch();
}
| Is This Answer Correct ? | 1 Yes | 0 No |
what is the acronym of the term 'C.O.M.P.U.T.E.R' ?
17 Answers Config Systems, Google, Wipro,
What are the different types of stl containers?
how to overload << and >> operator in c++
How does an stl file work?
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
Define the terms: field, record, table and database
write a program to demonstrate,how constructor and deconstructor work under multilevel inheritance
How connect plc and pc through software
Is there any error below, its a code to delete all entires from a map #include <map> #include iostream.h int main() { int i =0; map <int, char> TestMap; while(i<3) { TesMap.insert(TestMap::value_type(i,Test)); i++; } typedef map<int, char> :: iterator mapIter =TestMap.begin(); if(mapIter!=TestMap.end()) { TestMap.erase(mapItrer); ++mapIter; } return 0; }
sir please send me bpcl previous question papers
0 Answers BPCL Bharat Petroleum,
How stl is different from the c++ standard library?
write a program to search and display the position of an element in a single-dimentional array using function.