online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. *******************************************************************************/ import java.util.Scanner; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); ArrayList<Integer> DT = new ArrayList<>(); ArrayList<Integer> DF = new ArrayList<>(); ArrayList<Integer> DTF = new ArrayList<>(); System.out.println("enter the Range: "); int n = scan.nextInt(); int arr[] = new int[n]; for(int i=0; i<n; i++){ arr[i]=i+1; //System.out.println(arr[i]); if(arr[i]%3==0 && arr[i]%5==0) { DTF.add(arr[i]); //System.out.println("Divisible by both 3 & 5:" + arr[i]); } if(arr[i]%3==0) { DT.add(arr[i]); //System.out.println("Divisible by only 3:" + arr[i]); } if(arr[i]%5==0) { DF.add(arr[i]); //System.out.println("Divisible by only 5:" + arr[i]); } scan.close(); } System.out.println("divisible by 3: "+DT); System.out.println("divisible by 5: "+DF); System.out.println("divisible by 3&5: "+DTF); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue