Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Aaina
import java.util.*; public class Main { public static void main(String[] args) { System.out.println("0801IT181001"); 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
Please
log in
to post a comment.
Length of longest substring
end of bala session
log
linked lists
hello_world_test
Frequency
Satish Shankar Nikam
Java Procedural Progamming
3e
Program to generate random no. From 0 to 10
Please log in to post a comment.