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
alexandr402 [8]
3 years ago
7

5. Create a function named second_a that uses a list comprehension. The function will take a single integer parameter n. Find ev

ery number from 1 to n (inclusive) that is a palindrome which starts with the digit 3. Do not user a helper function.
Engineering
1 answer:
Mekhanik [1.2K]3 years ago
8 0

Answer:

//Program was implemented using C++ Programming Language

// Comments are used for explanatory purpose

#include<iostream>

using namespace std;

unsigned int second_a(unsigned int n)

{

int r,sum=0,temp;

int first;

for(int i= 1; I<=n; i++)

{

first = n;

//Check if first digit is 3

// Remove last digit from number till only one digit is left

while(first >= 10)

{

first = first / 10;

}

if(first == 3) // if first digit is 3

{

//Check if n is palindrome

temp=n; // save the value of n in a temporary Variable

while(n>0)

{

r=n%10; //getting remainder

sum=(sum*10)+r;

n=n/10;

}

if(temp==sum)

cout<<n<<" is a palindrome";

else

cout<<n<<" is not a palindrome";

}

}

}

Explanation:

The above code segments is a functional program that checks if a number that starts with digit 3 is Palindromic or not.

The program was coded using C++ programming language.

The main method of the program is omitted.

Comments were used for explanatory purpose.

You might be interested in
Why do you suppose a value of 5 is used? Do you think other values might work?
Shtirlitz [24]

Answer:

YES

Explanation:

values other than five will work

3 0
3 years ago
Cho biết tác dụng chung của các hệ giằng khung ngang nhà công nghiệp nhẹ 1 tầng 1 nhịp.
Dmitry_Shevchenko [17]
I don’t know how to speak the laungue or know this language
4 0
3 years ago
(TCO 1) Name one disadvantage of fixed-configuration switches over modular switches. a. Ease of management b. Port security b. F
frutty [35]

Answer:

The answer is A.

Explanation:

Two main types of network switches, modular and fixed configuration switches, are used for connecting the devices with one another provided they are on the same network.

As the name suggests, modular switches can be configured according to your needs and specific situations where you need a different setup.

The one advantage fixed-configuration switches have over the modular switches is that they are easier to operate. You can't change anything for a different application but they are simpler to setup and use, you can just plug them in and start using. They are usually for the more casual end-user and home networks etc.

I hope this answer helps.

5 0
3 years ago
How to make text take shape of object in affinity designer
Alina [70]

Answer:

To fit text to a shape in Affinity Designer, make sure you have your text selected. Then, grab the Frame Text Tool and click on the shape. A blinking cursor will appear within the shape, indicating that you can begin typing. The text you type will be confined to the boundaries of the shape.

Explanation:

6 0
3 years ago
A closed, rigid tank is lled with a gas modeled as an ideal gas, initially at 27°C and a gage pressure of 300 kPa. The gas is he
sergejj [24]

Answer:

T₂ =93.77  °C

Explanation:

Initial temperature ,T₁ =27°C= 273 +27 = 300 K

We know that

Absolute pressure = Gauge pressure + Atmospheric pressure

Initial pressure ,P₁ = 300+1=301 kPa

Final pressure  ,P₂= 367+1 = 368  kPa

Lets take  temperature=T₂

We know that ,If the volume of the gas is constant ,then we can say that

\dfrac{P_2}{P_1}=\dfrac{T_2}{T_1}

{T_2}=T_1\times \dfrac{P_2}{P_1}

Now by putting the values in the above equation we get

{T_2}=300\times \dfrac{368}{301}\ K

The temperature in  °C

T₂ = 366.77 - 273  °C

T₂ =93.77  °C

8 0
3 years ago
Other questions:
  • Consider the following class definitions: class smart class superSmart: public smart { { public: public: void print() const; voi
    6·1 answer
  • An air-standard Otto cycle has a compression ratio of 6 and the temperature and pressure at the beginning of the compression pro
    13·1 answer
  • What must engineers keep in mind so that their solutions will be appropriate? O abstract knowledge O context O scientists persev
    12·1 answer
  • Why is a building considered a type of system?
    6·1 answer
  • A metallic material with yield stress of 140 MPa and cross section of 300 mm x 100 mm, is subjected to a tensile force of 8.00 M
    12·1 answer
  • A heat pump and a refrigerator are operating between the same two thermal reservoirs. Which one has a higher COP?
    10·1 answer
  • ____ technologies are new technologies that are not currently widely employed.
    15·2 answers
  • An extruder barrel has a diameter of 4.22 inches and a length of 75 inches. The screw rotates at 65 revolutions per minute. The
    14·1 answer
  • For the system form of the basic laws, the momentum of a system can change as a result of: a. pressure acting on the system. b.
    14·2 answers
  • What do you think causes the differences in the properties of oxygen gas (O2) and ozone (O3)? the space between the atoms the ra
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!