We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public static void main(String[] args) {
double add= 0;
double sub=0;
double zero=0;
Scanner sc =new Scanner(System.in);
// System.out.println("Enter the no of elements");
int n =sc.nextInt();
int [] arr= new int[n];
// System.out.println("Enter the elements");
for(int i=0;i<arr.length;i++) {
arr[i]=sc.nextInt();
if (arr[i]>=1 && arr[i]<=100) {
add+=1;
}
if (arr[i]<=-1 && arr[i]>=-100) {
sub+=1;
}
if (arr[i]==0) {
zero+=1;
}
Plus Minus
You are viewing a single comment's thread. Return to all comments →
#
}