accept any 10 no count and display 1)no.of positive no
2)no.of negative no
3)no.of zeeos
Answers
Answered by
0
Answer:
import.java.util.*;
public class Accept_Number
{
public static void main (String Args[])
{
Scanner in=new Scanner (System.in);
int n,i, pn=0, nn=0, z=0;
for(I=1; i<=10; i++)
{
n=in.nextInt();
if(n>0)
pn++;
else if(n<0)
nn++;
else if(n==0)
}
Sopln("Number of positive no.="+pn);
Sopln("Number of negative no.="+nn);
Sopln("Number of zeroes="+z);
}
}
Similar questions