Use app×
QUIZARD
QUIZARD
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
17.2k views
in Computer by (49.9k points)
closed by

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 digit tech numbers. 

Example : 

Consider the number 3025 

Square of sum of the halves of 3025 = (30+25)

= (55)2 

= 3025 is a tech number.

1 Answer

+1 vote
by (49.0k points)
selected by
 
Best answer

import java.io.*; 

import java.util.*; 

class TechNumber 

public static void main(String args[ ]) 

int i, a, b, sum; 

String n; 

System.out.println(“Four Digits Tech Numbers are::”); 

for(i = 1000; i < 1000; i+ +) 

n = i +””; a = lnteger,parselnt(n.substring(0, 2)); 

b = Integer.parselnt(n.substring(2)); 

sum = (int)Math.pow((a + b), 2); if (sum == i) System.out.println(i); 

}

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...