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
Alice is an investor who has created a device controlled by an app that will water plants automatically. Alice has no experience
oksian1 [2.3K]

Answer:

3rd one

Explanation:

took test

5 0
3 years ago
Which of formula contains an absolute cell reference?
svet-max [94.6K]
Which formula contains an absolute cell reference? =SUM($B$7:$B$9)
3 0
3 years ago
I have a question involving do and for loops while using arrays.
larisa86 [58]

Answer:

i just got my new pc

Explanation:

5 0
3 years ago
_____ occurs within a single role, such as when a person receives conflicting messages from role senders about how to perform a
solmaris [256]

Answer:

Intra role Conflict

Explanation:

Intra role conflict basically talks about  expectations from a role sender on how to go about a particular task clashing with the behavior the person that received the role is exhibiting

4 0
3 years ago
Who primarily determines the value of a technology over time?
Novosadov [1.4K]

Answer:

a

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • Out of the following, find those identifiers, which cannot be used for naming Variables, Constants or Functions in a python prog
    11·1 answer
  • Explain how each of the five types of prewriting assist a writer in getting started. please make it short.
    15·1 answer
  • How can volunteering yo help plan fundraiser for your team or club be a way to develop your strengths?
    13·1 answer
  • Which city is the largest within the Andean and midlatitude countries? A. Buenos Aires, Argentina B. La Paz, Bolivia C. Santiago
    11·2 answers
  • Which of the following things could you do in order to tell if a pair of colors has strong contrast? A. Look at the colors on th
    12·1 answer
  • List the five parts of a system.describe them.
    13·1 answer
  • Write a method called removeInRange that accepts four parameters: an ArrayList of integers, an element value, a starting index,
    11·1 answer
  • Question 3
    13·1 answer
  • Which tools do you use for LinkedIn automation?
    14·1 answer
  • Difference between customized and packaged software​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!