FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Basic Programs in Python,Java & JavaScript: Smallest Number, Prime Number, and GCD
How-ToProgramming Languages

Basic Programs in Python,Java & JavaScript: Smallest Number, Prime Number, and GCD

via Dev.to PythonHarini3h ago

Finding the Smallest Number Among Three Using Ternary Operator What is a Ternary Operator? A ternary operator is a shorthand way of writing an if-else condition in a single line. Syntax: condition ? value_if_true : value_if_false; JavaScript Code let a = 5 , b = 2 , c = 8 ; let smallest = ( a < b && a < c ) ? a : (( b < c ) ? b : c ) console . log ( " Smallest number is: " ) Python Code a = int ( input ( " Enter number 1: " )) b = int ( input ( " Enter number 2: " )) c = int ( input ( " Enter number 3: " )) smallest = a if ( a < b and a < c ) else ( b if b < c else c ) print ( " Smallest number is: " , smallest ) Java Code public class SmallestNumber { public static void main ( String [] args ) { int a = 5 , b = 2 , c = 8 ; int smallest = ( a < b && a < c ) ? a : (( b < c ) ? b : c ); System . out . println ( "Smallest number is: " + smallest ); } } Output How to find prime numbers within a given range A prime number is a number greater than 1 that has only two factors: 1 and itself Ex

Continue reading on Dev.to Python

Opens in a new tab

Read Full Article
0 views

Related Articles

How-To

Building a Runtime with QuickJS

Lobsters • 1h ago

I can't stop talking about the Ninja Creami Swirl - and it's on sale at Amazon right now
How-To

I can't stop talking about the Ninja Creami Swirl - and it's on sale at Amazon right now

ZDNet • 2h ago

How-To

Do Beginners Still Search "How to Code"?

Medium Programming • 2h ago

How to Become a Software Developer After 12th?
How-To

How to Become a Software Developer After 12th?

Medium Programming • 3h ago

Claude Code Essentials
How-To

Claude Code Essentials

FreeCodeCamp • 3h ago

Discover More Articles