import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
System.out.println("enter a number");
int i = inp.nextInt();
int o =i+i;
System.out.println(o);
}
Scanner inp = new Scanner(System.in);
System.out.print("In:");
String word = inp.nextLine();
int counter = word.length();
for(counter>0){
System.out.println(word.charAt(counter));
int counter-1;
}
}
This are the errors I get:
exit status 1
Main.java:16: error: <identifier> expected
System.out.print("In:");
^
Main.java:16: error: illegal start of type
System.out.print("In:");
^
Main.java:19: error: illegal start of type
for(counter>0){
^
Main.java:19: error: <identifier> expected
for(counter>0){
^
Main.java:19: error: ';' expected
for(counter>0){
^
Main.java:19: error: illegal start of type
for(counter>0){
^
Main.java:19: error: <identifier> expected
for(counter>0){
^
Main.java:19: error: ';' expected
for(counter>0){
^
Main.java:20: error: illegal start of type
System.out.println(word.charAt(counter));
^
Main.java:20: error: ';' expected
System.out.println(word.charAt(counter));
^
Main.java:20: error: invalid method declaration; return type required
System.out.println(word.charAt(counter));
^
Main.java:20: error: <identifier> expected
System.out.println(word.charAt(counter));
^
Main.java:20: error: ';' expected
System.out.println(word.charAt(counter));
^
Main.java:20: error: illegal start of type
System.out.println(word.charAt(counter));
^
Main.java:20: error: <identifier> expected
System.out.println(word.charAt(counter));
^
Main.java:21: error: ';' expected
int counter-1;
^
Main.java:24: error: class, interface, or enum expected
}
^
17 errors