Scanner input = new Scanner(System.in);
System.out.println("Please enter the name of the first subject");
String A = input.nextLine();
System.out.println("Please enter marks in subject " + A );
float a = input.nextFloat();
**System.out.println("Please enter the name of the second subject");
String B = input.nextLine();
System.out.println("Please enter the marks of the subject "+ B );**
float b = input.nextFloat();
System.out.println("Please enter the name of the last subject");
String C = input.nextLine();
In this code I expect that program to ask the name of second subject after taking in the value for first subjet marks but instead its printing both the print statement for second subject and ignoring to take the second subject name.