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
A certain working substance receives 100 Btu reversibly as heat at a temperature of 1000℉ from an energy source at 3600°R. Refer
Valentin [98]

Answer:

Explanation:

t1 = 1000 F = 1460 R

t0 = 80 F = 540 R

T2 = 3600 R

The working substance has an available energy in reference to the 80F source of:

B1 = Q1 * (1 - T0 / T1)

B1 = 100 * (1 - 540 / 1460) = 63 BTU

The available energy of the heat from the heat wource at 3600 R is

B2 = Q1 * (1 - T0 / T2)

B2 = 100 * (1 - 540 / 3600) = 85 BTU

The reduction of available energy between the source and the 1460 R temperature is:

B3 = B2 - B1 = 85 - 63 = 22 BTU

6 0
3 years ago
Joe is a chemical engineer whose plant discharges heavy metals into the local river. By the test authorized by the city governme
chubhunter [2.5K]

Answer:

B probably

Explanation:

Because the prompt doesn't specify what sort of violation it could be anything maybe when they release the metals during the day and so on.

5 0
3 years ago
An angle is observed repeatedly using the same equipment and procedures producing the data below:35 ∘ 40'00",35 ∘ 40'10",35 ∘ 40
Helen [10]

Answer: (a) +/- 7.5° (b) +/- 3.75°

Explanation:

See attachment

6 0
3 years ago
What is civil engineering​
kkurt [141]

Answer:

engineering that works on building structures.

Explanation:

7 0
4 years ago
The use of seatbelts in a car has significantly reduced the number of crash fatalities. Which statement best explains how societ
satela [25.4K]

as the public need for preventing injuries and deaths from car crashes became known,laws were enacted to mandate the inclusion of seatbelts in almost all passengers vehicles

8 0
3 years ago
Other questions:
  • In , the industries with the most complaints to the Better Business Bureau were banks, cable and satellite television companies,
    13·1 answer
  • The 150-lb man sits in the center of the boat, which has a uniform width and a weight per linear foot of 3 lb&gt;ft. Determine t
    9·1 answer
  • Flue gases from an incinerator are released to atmosphere using a stack that is 0.6 m in diameter and 10.0 m high. The outer sur
    12·1 answer
  • Calculate the thermal efficiency (ηth) for the actual cycle using pump efficiency (ηpump) = 0.85. You’ll need to find the high-p
    13·2 answers
  • A rotating cup viscometer has an inner cylinder diameter of 2.00 in., and the gap between cups is 0.2 in. The inner cylinder len
    9·1 answer
  • What are four types of biomass that can be converted into alternative fuels
    9·1 answer
  • Which of the following is an early practice of sustainable farming?
    13·1 answer
  • # line 1 age = int(input("Enter your age: ")) # line 3 print("Invalid input") If we want the computer to display "Invalid input"
    11·1 answer
  • Wattage is:
    9·1 answer
  • Based on its atomic number, how many electrons does a hydrogen atom have
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!