Hello all,
I am trying to take input from user using scanner. The problem is, when the loop starts, it skips taking input for the first iteration. Here is the code:
import java.util.Scanner;
public class TrigTriangles{
public static void main(String[] args){
int N;
double a,b,c;
double A,B,C;
Scanner s = new Scanner(System.in);
C=90;
char[] charArray;
String input;
System.out.println("Enter N: ");
N = s.nextInt();
for(int i = 0; i < N; i++){
System.out.println("Enter line: ");
input = s.nextLine();
System.out.println(input);
/* charArray = input.toCharArray();
if(Character.isUpperCase(input.charAt(0))){
System.out.println("It is uppercase!");
}
*/
}
}
}