Computer Science, asked by nathandrake9862, 1 year ago

A tech number has even number of digits if the number is split in two equal halves then the square of sum of these halves is equal to the number itself write a program to generate and print all four digits tech numbers

Answers

Answered by god55
15

Answer:

It is absolutely correct check it out

Attachments:
Answered by mad210219
1

Given:

A tech number has even number of digits if the number is split in two equal halves then the square of sum of these halves is equal to the number itself

To find:

Write a program to generate and print all four digits tech numbers

SOLUTION:

for i in range(1000,10000):

     s=str(i)

     d=len(s)

     if(d%2==0):

             a1=pow((int(s[:d/2])),2)  

             a2= pow((int(s[d/2:])),2)

             if (a1+a2)==i:

                         print(i)

             else:

                         pass

                                 

               

                     

                     

Similar questions