Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Main.java
import java.util.*; public class Main { public static void main(String[] args) { System.out.println("0801IT181082"); Scanner sc=new Scanner(System.in); System.out.println("enter a number"); int n=sc.nextInt(); int s=0; for(int i=n;i>0;i/=10){ s=s+i%10;} System.out.println("Sum of digits is:"+s); }}
run
|
edit
|
history
|
help
0
H
Reverse Prime
Odd Numbers
Java Functional Programming
Meena
Find Case Combinations of a String
js
Account JAVA Cpa
Filter Iterator
A.K.JAVA_EXPERIENCE_1