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]
2 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]2 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
Introduce JTA and JT
Vinil7 [7]
JT2 oaoaosnforeneomdocdmsnsksmsmsodnfnfj
7 0
2 years ago
Diffrent ways to make a header above a window
Oliga [24]

Answer: double click at the top of the page. Or you can also go to home file and click add heading.

Explanation:

5 0
3 years ago
Cynthia is producing a sculpture using material introduced in the Bronze Age. What two metals is she mixing?
Airida [17]
The correct answer
would be d
Iron and carbon
hope this helps
5 0
2 years ago
How to draw the output voltage waveform rectifier
tatyana61 [14]

Answer:

Half-wave rectifier converts an AC signal into a DC signal. It's called a half-wave because it only rectify the positive part of an AC signal.

AC Signal = An electrical signal that alternates between positive and negative voltage.

DC Signal = An electrical signal that only has positive voltage.

Rectify = A fancy word for converting something.

Adding a capacitor helps the positive part of the signal stay on longer. This work because the capacitor stores energy kinda like a battery. During the negative part of the AC signal, the energy stored in the capacitor will be drained and used, then the cycle repeats.

The load resistor is just there to prevent a short circuit from happening.

7 0
2 years ago
A reversible compression of 1 mol of an ideal gas in a piston/cylinder device results in a pressure increase from 1 bar to P2 an
Mashutka [201]

Answer:

attached below

Explanation:

6 0
3 years ago
Other questions:
  • There are 20 forging presses in the forge shop of a small company. The shop produces batches of forgings requiring a setup time
    10·1 answer
  • Write a program to control the operation of the RED/GREEN/BLUE LED (LED2) as follows: 1. If no button is pressed, the LED should
    15·1 answer
  • A manager has a list of items that have been sorted according to an item ID. Some of them are duplicates. She wants to add a cod
    7·1 answer
  • ). A 50 mm diameter cylinder is subjected to an axial compressive load of 80 kN. The cylinder is partially
    8·1 answer
  • What is the difference between POP3 and IMAP?
    5·1 answer
  • What is the relationship between compressor work and COPR?
    14·1 answer
  • For a bolted assembly with eight bolts, the stiffness of each bolt is kb = 1.0 MN/mm and the stiffness of the members is km = 2.
    14·1 answer
  • How to install a curt 5th wheel hitch in a 2017 chevy silverado
    14·1 answer
  • What setting do i dry my jordan max arua 2s on in the dryer <br>will mark brainliest
    8·1 answer
  • can anyone help me with this please.i have the current and pf for branch 1 and 2 but cant figure out the total current, pf and a
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!