Computer Science, asked by manzar7548, 1 month ago

in Virtual Machine Take any integer from user. If it’s positive, print the integer. Otherwise,

program should be closed.​

Answers

Answered by sanasiju
2

Answer:

import java.uti.*;

public class positive {

public static void main (String [] args){

Scanner s =new Scanner (System.in);

System.out.println("Enter number");

int a =s.nextInt();

if(a>0)

System.out.println(a);

}}

Explanation:

pls mark as BRAINLIEST I will follow and thank you

Similar questions