โ† TCS questions
CodingReported in a candidate post, Oct 2018

Write a Java program to check if a number is prime or not

Filed under TCS

Write a program in Java to determine if a given integer is a prime number, optimizing the loop to minimize the number of iterations.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related TCS questions

Collected from public candidate posts and coding forums. Updated Nov 2026.