1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
KATRIN_1 [288]
3 years ago
13

A palindrome number is a number that remains the same when its digits are reversed. Like 16461, for example, is a palindrome num

ber .Write a Program to generate the Palindrome numbers between 1 and 200 in an output file named "palindrome.txt" .

Computers and Technology
1 answer:
xxMikexx [17]3 years ago
5 0

Answer:

Code is given below and output is attached as an image.

Explanation:

#include <iostream>

#include <fstream>

using namespace std;

bool isPalindrome(int n)

{

       // Find reverse of n

       int rev = 0;

       for (int i = n; i > 0; i /= 10)

               rev = rev * 10 + i % 10;

       // If n and rev are same,then n is a palindrome

       return (n == rev);

}

int main()

{

       int min = 1;        // Lower Bound

       int max = 200;      // Upper Bound

       ofstream myfile;

       myfile.open("palindrome.txt");

       for (int i = min + 1; i < max; i++)

               if (isPalindrome(i))

                       myfile << i << endl;

       myfile.close();

       return 0;

}

You might be interested in
Please list the computer data hierarchy from bit to database
vladimir2022 [97]

Answer:

 Data hierarchy is basically define to the data which is organized in the systematic manner. The main concept of the data hierarchy is to check the basic structure of the data. It basically involve the fields records and files for the data organization.

The following is the list of the computer data hierarchy from nit to address are:

1) Bit: It is the smallest unit of the data.

2) Field: The collection of all the characters in the data is known as field.

3) Record: The collection of the different fields is known as records.

4) File: The collection of various types of records in the database is known as file.

8 0
3 years ago
Your computer uses 4 bits to represent decimal numbers (0, 1, 2, 3 and so on) in binary. What is the SMALLEST number for which a
natali 33 [55]
2 I think because 2 I think is binary I’m sorry if this is wrong
8 0
2 years ago
If you enter 234.567 into a cell that is formatted to display 1 decimal point place, what is the value stored in the cell
zalisa [80]

IT WILL NOT BE 234.6 FOR PF GANG JUST TOOK THE TEST

6 0
3 years ago
A(n) _______________ CRM provides all users with the tools and information they need to fit their individual roles and preferenc
fgiga [73]
A(n) "Portal-based" CRM provides all users with the tools and information they need to fit their individual roles and preferences.
4 0
3 years ago
What value(s) can be input into this code for the value of number that will cause the code in the loop to execute? Scanner keybo
Marianna [84]

Answer:

There is no value of the number variable, for which the loop can be true in any iteration.

Explanation:

  • The above loop states the condition that the value should be less than 100 and greater than 500. It is because the loop holds the and condition which gives the true if both conditions will be true.
  • The first condition of the while loop states that the value of the number variable is less than the 100.
  • The second condition of the while loop state that the value of the number variable is greater than the 500.
  • The and condition of the while loop will true if both conditions will true.
  • But there is no number which is less than 100 and greater than 500.
  • So no number can satisfy the while condition to be true.

5 0
3 years ago
Other questions:
  • Which of the following is NOT an ethical way of getting to the top of a web search?
    5·1 answer
  • In number theory, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the
    12·1 answer
  • If you're doing a relational comparison, which filter would be available?
    15·1 answer
  • ______ is using material created by others without obtaining permission from the original authors.
    10·2 answers
  • Traffic that is encrypted will typically pass by an intrusion prevention system untouched.a. Trueb. False
    10·1 answer
  • How is the internet made?
    7·1 answer
  • How do i move a file in python3
    10·1 answer
  • Could someone please help?​
    10·1 answer
  • Which line of code in this program is MOST likely to result in an error
    15·2 answers
  • Pls help quick... will mark brainliest...
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!