online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
import java.util.Scanner; public class Main { public static void main(String[] args) { String sentence = "Lorem ipsum dolor sit amet, consectetur "; // Create a Scanner object to scan words from the sentence Scanner scanner = new Scanner(sentence); // Count the number of words int wordCount = 0; while (scanner.hasNext()) { scanner.next(); // Move to the next word wordCount++; } System.out.println("The number of words is " + wordCount + "."); // Close the scanner to free resources scanner.close(); } }

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