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
When might it be necessary or advisable to write a shell script instead of a shell function? give as many reasons as you can thi
Romashka-Z-Leto [24]

A shell function will do nothing unless it is explicitly called by other code, typically in a shell script. A shell script is a running executable process, which can call other shell scripts and/or functions. Typical operations performed by shell scripts include file manipulation, program execution, and printing text.

3 0
2 years ago
8. Choose the 3 correct statements for the code below.
Ksju [112]

The correct statements for the code below are:

  • An object of the ActivationLayer class has a name attribute.
  • print(FCLayer(42)) prints FullyConnectedLayer.
  • When creating an object of the BaseLayer class, the name argument must be given.

<h3>What is activation layer?</h3>

Activation layer is known to be the added into the code after the weight layer.

Note that The correct statements for the code below are:

  • An object of the ActivationLayer class has a name attribute.
  • print(FCLayer(42)) prints FullyConnectedLayer.
  • When creating an object of the BaseLayer class, the name argument must be given.

See options below

An object of the ActivationLayer class has a name attribute.

An object of the BaseLayer class has a size attribute.

print(FCLayer(42)) prints FullyConnectedLayer.

When creating an object of the ActivationLayer class, the size argument must be given.

When creating an object of the BaseLayer class, the name argument must be given.

Learn more about code from

brainly.com/question/26497128

#SPJ1

7 0
1 year ago
On most computers, the default font size in Word is ____. 8 11 14 16
julsineya [31]
The font size depends on how the computer can handle font size or the monitor's size.
Mostly, it's 16.

To move one up paragraph, it's +UP ARROW
8 0
3 years ago
Determine the number of bytes necessary to store an uncompressed RGB color image of size 640 × 480 pixels using 8, 10, 12 and 14
dexar [7]

Answer:

For 8 bits / Color Channel: 921, 600 bytes.

For 10 bits / Color Channel: 1,152,000 bytes.

For 12 bits / Color Channel: 1,382,400 bytes.

For 14 bits / Color Channel : 1,612, 800 bytes.

Explanation:

Un uncompressed RGB color image of 640 pixels wide by 480 pixels height (VGA resolution) uses 3 samples of x bits fin order to represent the quantity of each primary color (red, green and blue) in a given pixel of the image.

So, if we use 8 bits/ sample, we can calculate the bytes needed to store a complete image as follows:

640*480*3*8 bits = 7, 372,800 bits. (1)

As, by definition, 1 byte= 8 bits, we have:

Nº of bytes = 7,372,800 / 8 = 921,600 bytes. (2)

In order to get the bytes needed to store the same image, using 10, 12 and 14 bits/ sample, all we need is replacing 8 by 10, 12 and 14 in (1), and then dividing by 8 as in (2).

Proceeding in this way we obtain:

640*480*3*10 = 9,216,000 bits ⇒    1,152,000 bytes.

640*480*3*12 = 11,059,200 bits ⇒   1,382,400 bytes.

640*480*3*14=   12,902,400 bits ⇒  1,612,800 bytes.

8 0
3 years ago
Does anyone know this ? this website is scratch btw.
Katarina [22]

Answer:

maybe select an instrument

7 0
3 years ago
Other questions:
  • You work for a large enterprise company that handles time-sensitive information. Your supervisor has asked that you set up a con
    8·1 answer
  • Select all that apply. Hyperlinks can appear as: words pictures symbols trademarks
    12·2 answers
  • a reviewer is required to enter a reason in the comments field only when a candidate is recommended to be hired. which action ca
    8·1 answer
  • In the table below identify the data type that would be most suitable for the second field
    14·1 answer
  • My computer just fried anybody know why it did that?
    14·2 answers
  • How do you change your grade level
    10·1 answer
  • In order to detect repeated lines anywhere in the input, myuniq must keep track of all of the lines it has seen as it moves thro
    9·1 answer
  • What is the main difference between weathering, erosion and leaching​
    9·1 answer
  • Is monitor is a television​
    5·2 answers
  • 6
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!