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
Answer ppeeeeeaaaalll
Bad White [126]

Answer:

what

Explanation:

is this an exam or an test or what is it

3 0
2 years ago
Driving Distraction Brainstorming Session
Leto [7]

texting, phone calls, putting on makeup, brushing hair, movies playing in car, loud music, children, and that's pretty much all I could think of

please give <u>BRAINLIEST ANSWER └[T‸T]┘</u>

5 0
3 years ago
what do we call a landslide in which fine-grained soil moves cohesively but with extensive internal shearing?
pogonyaev
It is called an earth flow
5 0
3 years ago
Which career best fits the group of the words below? High voltage, lines
Llana [10]

Answer:

I forget the word for it, but probably the guys who set up the power lines in the city.

Explanation:

5 0
3 years ago
Read 2 more answers
Think about how could you design, build, and test a light maze. What specific behavior of light will be essential to the success
Mrac [35]

Answer:

Reflection

Explanation:

The specific behavior of light that will be essential to ensure the success of your design is "Reflection". This is because light maze makes use of a mirror and it's the light that is reflected that we see with our eyes. Also, the manner in which light is reflected off objects will affect the colors that are reflected as well.

4 0
3 years ago
Other questions:
  • Write a complete C++ program that is made of functions main() and rShift(). The rShift() function must be a function without ret
    7·1 answer
  • The angle of twist can be computed using the material’s shear modulus if and only if: (a)- The shear stress is still in the elas
    14·1 answer
  • WhT DO FILM PRODUTION SAY WHEN REMOVING GREEN AND BLUE SCREENS.
    14·1 answer
  • The component of a fluid system where a fluid is stored, but not under pressure, is called a container.
    5·1 answer
  • True or False? Duties of the company officials should be discussed
    11·1 answer
  • A hydraulic cylinder has a 125-mm diameter piston with hydraulic fluid inside the cylinder and an ambient pressure of 1 bar. Ass
    8·1 answer
  • Problematic substances mechanical engeneering???
    6·1 answer
  • What parts of a ship have plastic? And what type of plastic?
    8·1 answer
  • Please help me. I have no idea what I'm doing.​
    14·2 answers
  • malott, m. e. (2003). paradox of organizational change: engineering organizations with behavioral systems analysis.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!