Answers for "java print number and text"

0

Write a java program to print a number from the user

import java.util.Scanner;public class Main{public static void main(String args[]){int number;Scanner scan = new Scanner(System.in);System.out.print("Enter the number ");number = scan.nextInt();System.out.print("Entered number " +number);}}
Posted by: Guest on June-12-2021
0

java print number and text

import java.util.Scanner;
public class Main
{
    public static void main(String args[])
    {
        int number;
        Scanner scan = new Scanner(System.in);
        System.out.print("Enter the number ");
        number = scan.nextInt();
        System.out.print("Entered number " +number);
            }
    }
    
    Output:

Enter the number 5
Entered number 5
Posted by: Lucas Miller on July-02-2022

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language