Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
3a
//'main' method must be in a class 'Rextester'. //openjdk version '11.0.5' //Lokesh reddy 7002 import java.util.*; import java.lang.*; class Rextester { public static void main(String args[]) { int n; int sum; Scanner in = new Scanner(System.in); System.out.println("Enter the number:\n"); n=in.nextInt(); sum=0; for(int i=1;i<=n;i++) { sum+=i; } System.out.println("The sum of numbers up to "+n+" is :"+sum); } }
run
|
edit
|
history
|
help
0
Convert string array to lowercase.
Test
Frequency
Problem: on_off
Escaping Literals (Table of records)
BinarySearch
3rd
updated
calc
HelloWorld2