Pages

Thursday, March 20, 2025

Scanner in Java!

 import java.util.*;


public class JavaBasics {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
            // String input = sc.next();
            // System.out.println(input);


            // String name = sc.nextLine();
            // System.out.println(name);

        int number = sc.nextInt();
        System.out.println(number);

        float price = sc.nextFloat();
        System.out.println(price);
    }

}



Practice questions to strengthen this part of concept, it will help a-lot.

No comments:

Post a Comment

how to become red on codeforces by Errichto Algorithms | explained simply in a blog

 Yes. I found an available transcript of the video and summarized it simply. The video is “How To Become Red Coder? (codeforces.com)” by Err...