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
Who plays blox burg???
xeze [42]

Answer:

I don't have robux

Explanation:

but i love adopt me

7 0
3 years ago
Read 2 more answers
In C++ the declaration of floating point variables starts with the type name float or double, followed by the name of the variab
zubka84 [21]

Answer:

The given grammar is :

S = T V ;

V = C X

X = , V | ε

T = float | double

C = z | w

1.

Nullable variables are the variables which generate ε ( epsilon ) after one or more steps.

From the given grammar,

Nullable variable is X as it generates ε ( epsilon ) in the production rule : X -> ε.

No other variables generate variable X or ε.

So, only variable X is nullable.

2.

First of nullable variable X is First (X ) = , and ε (epsilon).

L.H.S.

The first of other varibles are :

First (S) = {float, double }

First (T) = {float, double }

First (V) = {z, w}

First (C) = {z, w}

R.H.S.

First (T V ; ) = {float, double }

First ( C X ) = {z, w}

First (, V) = ,

First ( ε ) = ε

First (float) = float

First (double) = double

First (z) = z

First (w) = w

3.

Follow of nullable variable X is Follow (V).

Follow (S) = $

Follow (T) = {z, w}

Follow (V) = ;

Follow (X) = Follow (V) = ;

Follow (C) = , and ;

Explanation:

4 0
3 years ago
Each of the following activities are commonly performed during the implementation of the Database Life Cycle (DBLC). Fill in the
kicyunya [14]
Yessiree I agree with yu cause yu are right
4 0
3 years ago
Which kind of fracture (ductile or brittle) is associated with each of the two crack propagation mechanisms?
Nina [5.8K]

dutile is the correct answer

6 0
3 years ago
5. One of the major road blocks for direct DC power in residences is the ___. A) generation of DC B) lack of standardization C)
Montano1993 [528]

Answer:

D) quantity of components required for this type of system

Explanation:

Electricity can be transmitted using the alternating and direct currents. The alternating current is one in which the flow of the current diverts at certain time intervals whereas, the direct current is one in which there is a constant one-directional flow of current. The DC is used in batteries and solar panels. Residential areas and business places make use of the AC current.

One of the several reasons why the DC is not used in homes is because unlike the AC it is not easy to build and sustain. Moreso, it has more components compared to the AC. For example, its motor consists of brushes and commutators . The components, example, switches are also large compared to the AC components.

6 0
3 years ago
Other questions:
  • Magnesium sulfate has a number of uses, some of which are related to the ability of the anhydrate form to remove water from air
    15·1 answer
  • If superheated water vapor at 30 MPa iscooled at ​constant pressure​, it will eventually become saturated vapor, and with suffic
    5·1 answer
  • A wall in a house contains a single window. The window consists of a single pane of glass whose area is 0.15 m2 and whose thickn
    10·1 answer
  • Define Plastic vs elastic deformation.
    13·1 answer
  • A six-lane divided highway (three lanes in each direction) is on rolling terrain with two access points per mile and has 10- ft
    7·1 answer
  • Air is to be heated steadily by an 8-kW electric resistance heater as it flows through an insulated duct. If the air enters at 5
    10·1 answer
  • Our aim is to calculate the efficiency of a gas turbine by assuming it operation can be modeled as a Carnot cycle. The kerosene
    9·1 answer
  • A series RC circuit has a voltage of 24VAC and an impedance of 252ohms. What is the circuit current?
    6·1 answer
  • How to clean a snowblower carburetor without removing it.
    11·1 answer
  • What is software certification? Discuss its importance in the changing scenario of software industry. ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!