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
docker41 [41]
3 years ago
10

Find every number from 1 to n (inclusive) that is a palindrome which starts with the digit 3. Do not user a helper function.

Computers and Technology
1 answer:
Mkey [24]3 years ago
7 0

Answer: Following code is in python

n=input()

num='1'

while int(num)<=int(n):    //loop from 1 to n

   flag=1   //if an unequal element will be found it will be 0

   l=len(num)

   if num[0]=='3':

       j=0

       k=l-1

       while j<k:    //loop till middle of number

           if num[j]==num[k]:

               j+=1     //from beginning

               k-=1    //from end

           else:

               flag=0

               break

       if flag==1:

           print(int(num))

   num=str(int(num)+1)    //number will be incremented as integer

INPUT :

1000

OUTPUT :

3

33

303

313

323

333

343

353

363

373

383

393

Explanation:

In the above code, a loop is executed till num is equal to n which is entered by the user. num is treated as a string so that to ease the process of checking first character is 3 or not. If it is 3 then another loop executes which checks if an element from starting is equal to the corresponding element from the end. If an element is not equal then the flag is changed and then we break out of the loop and prints the number if the flag isn't changed.

You might be interested in
What is a sensitive compartmented information program
Dahasolnce [82]

Answer:

cpu

Explanation:

4 0
3 years ago
The destructor automatically executes when the class object goes out of ____.
Tema [17]

Answer:

scope    

Explanation:

Destructor is a member function and it call automatically when the class object goes out of scope.

Out of scope means, the program exit, function end etc.

Destructor name must be same as class name and it has no return type.

syntax:

~class_name() { };

For example:

class xyz{

  xyz(){

        print(constructor);

   }

~xyz(){

        print(destructor);

   }

}

int main(){

    xyz num;

   

}//end program

when the object is create the constructor will called and when the program end destructor will call automatically.

4 0
3 years ago
What is 11x12x12x14x15x16
ser-zykov [4K]

Answer:

11x12x12x14x15x16=5,322,240

Explanation:

11*12=132

12*14=168

15*16=240

132*168=22,176

240*22,176=5,322,240

Have a nice day! :)

4 0
2 years ago
Raul needs to ensure that when users enter an order into the tblOrders, the shipping date is at least two days after
bagirrra123 [75]

Answer:

input mask

Explanation:

Microsoft Access is a database application used to stored data. It is a relational database with rows and columns of data tables in its database.

Data validation is a tool in Access used to put a constraint on how data is entered in the table. The input mask is a data validation type that forces users to enter data in a specified format for a given field or column.

7 0
2 years ago
Read 2 more answers
The ____ criteria filter requires the records displayed to start with the specified text string
lys-0071 [83]

The "Begins With" criteria filter is what your looking for

3 0
3 years ago
Other questions:
  • Which of the following is not an impact device?<br> Joy Stick<br> Track Ball<br> Mouse<br> Printer
    10·1 answer
  • Jenny wants to create a résumé after a two-years gap. What should she consider?
    11·2 answers
  • If you want to be more efficient at using the World Wide Web, refresh the page often.
    7·1 answer
  • Which would increase electric current? increasing the resistance increasing the size of the wire decreasing the voltage
    6·1 answer
  • What is the role of the federal government in regulating the media and the internet?
    6·2 answers
  • What disese is sue suffering from
    15·2 answers
  • You want to deploy a software package that's available to all users in the domain if they want to use it, but you don't want the
    7·1 answer
  • To open a Google Doc in another software application, the user must first download it. True or false?
    12·2 answers
  • Discuss All control statements supported by Go
    13·1 answer
  • Can someone make me a natural selection comic but only 5 same thing in the example pic but draw the animal different and a diffe
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!