You are viewing a single comment's thread. Return to all comments →
My Java Code :
public static void main(String[] args) {
double po=0, neg =0, ze =0; Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int ar[] = new int[n]; for(int i=0; i<n ; i++) { ar[i] = sc.nextInt(); if(ar[i] >0) po++; else if (ar[i]< 0) neg++; else ze++; } System.out.println(po/n); System.out.println(neg/n); System.out.println(ze/n); }
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
My Java Code :
public static void main(String[] args) {