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
Number Operations (Sum, Count, Reverse) Using Loop in Java
NewsProgramming Languages

Number Operations (Sum, Count, Reverse) Using Loop in Java

via Dev.toVidya3h ago

Sum of Digits java public class Main { public static void main ( String [] args ) { int num = 1234 , sum = 0 ; while ( num > 0 ) { sum += num % 10 ; num = num / 10 ; } System . out . println ( "Sum = " + sum ); } } output 2. Count of Digits java public class Main { public static void main ( String [] args ) { int num = 1234 , count = 0 ; while ( num > 0 ) { num = num / 10 ; count ++; } System . out . println ( "Count = " + count ); } } output 3. Reverse a Number public class Main { public static void main ( String [] args ) { int num = 1234 , rev = 0 ; while ( num > 0 ) { rev = rev * 10 + num % 10 ; num = num / 10 ; } System . out . println ( "Reverse = " + rev ); } } output

Continue reading on Dev.to

Opens in a new tab

Read Full Article
3 views

Related Articles

News

The Tooling Layer. What Sits Around Models and Why It Matters.

Medium Programming • 3h ago

News

FlowG - Road to 1.0

Lobsters • 4h ago

Kia shows off small cars in NY: The 2027 EV3 and 2027 Seltos Hybrid
News

Kia shows off small cars in NY: The 2027 EV3 and 2027 Seltos Hybrid

Ars Technica • 4h ago

The New Era of Militia Influencers
News

The New Era of Militia Influencers

Wired • 4h ago

This Android camera accessory helped me spot a hidden electrical hazard just in time
News

This Android camera accessory helped me spot a hidden electrical hazard just in time

ZDNet • 5h ago

Discover More Articles