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
Time complexity of merge sort
vovangra [49]

Answer:

The correct answer is "O (n\times Log n)". A further explanation is given below.

Explanation:

  • Throughout all the three instances (worst, average as well as best), the time complexity including its Merge sort seems to be O (n\times Log n) as the merge form often splits the array into two halves together tends to linear time to combine multiple halves.
  • As an unsorted array, it needs an equivalent amount of unnecessary capacity. Therefore, large unsorted arrays are not appropriate for having to search.
6 0
3 years ago
I am very clueless
MArishka [77]
When two people put in an answer it tells u to mark someone. Like u can try it on me
5 0
3 years ago
Read 2 more answers
Which of the following leaf modifications is beneficial in a low-light environment, e.g., the understory of a rainforest? (More
Mnenie [13.5K]

Answer: A, B and D.

Explanation:

A) If a leaf is iridescent and reflects light or colors from other objects, it helps to stand out from the rest in a low-light environment.

B) The anthocyanin pigments give the leaf a different coloration, so it has a different impact in a darker o flat colored space.

D) Having a large surface area will help to stand out from plants with small leaves.

5 0
3 years ago
Nitrogen at an initial state of 300 K,150 kPa and 0.2 m3is compressed slowly in an isothermal process to a final pressure of 800
Dmitry_Shevchenko [17]

Answer:

-50.22kJ

Explanation:

Given:

Initial state Temperature =300k

Pressure 1= 150kPa

Pressure 2 = 800kPa

Volume 1 = 0.2m^3

Work done = Pressure 1 × Volume 1 × (inverse of pressure 1 ÷ pressure 2)

= 150kPa × 0.2m^3 × (inv 150 kPa ÷800 kPa)

= - 50.22kJ

3 0
3 years ago
HfrrghhJbfrfefefft nbgyjjiutrwdgju
Tasya [4]

Answer:

hshdhriwjajaldh skshdjdywuusg

Explanation:

null

4 0
3 years ago
Other questions:
  • When you are configuring data deduplication, you must choose a usage type for the volume you are configuring. Which of the follo
    8·1 answer
  • The pulley has mass 12.0 kg, outer radius Ro=250 mm, inner radius Ri=200 mm, and radius of gyration kO=231 mm. Cylinder A weighs
    14·1 answer
  • For problems 1 and 2, six luminaires, similar to Style E used in the Commercial Building, are to be installed in a room that is
    13·1 answer
  • Batteries typically have ratings stated in ampere-hours, that let you estimate the length of time any particular current level c
    9·1 answer
  • What are the use of logic gates in the field of robotics?
    10·1 answer
  • Stucco will shrink as it hardens and cures.<br> A. true<br> B. false
    11·1 answer
  • The demand for Manufacturing jobs is O decreasing O increasing O slowly changing. O remaining constant.​
    6·2 answers
  • Sketches are a very efficient way to share ideas.<br> True<br> False
    13·2 answers
  • What is the physical mechanism that causes the friction factor to be higher in turbulent flow?
    13·1 answer
  • Aqueous cleaners are ________ parts cleaning agents.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!