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; public class Main { public static void main(String[] args) { // الكائن المسؤول عن المدخلات Scanner sc = new Scanner(System.in); System.out.println("أدخل عدد صحيح: "); // إستعمال البلوك try and catch حيث عند حدوث خطأ لا نعرضه للمستخدم try { int number = sc.nextInt(); System.out.println("القيمة المطلقة للعدد: " + number + " هي: " + absolute(number)); } catch (Exception e) { System.out.println("لقد أخطأت يرجي المحاولة لاحقا"); } } // هنا قمنا بتعريف الاقتران الذي سيقوم بحساب القيمة المطلقة لعدد صحيح private static int absolute(int number) { return number >= 0 ? number : -number; } }

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