Skip to content

Instantly share code, notes, and snippets.

@MukulLatiyan
Created October 22, 2017 23:05
Show Gist options
  • Save MukulLatiyan/7c060afbb8ec0ededd042284b3f5ea2e to your computer and use it in GitHub Desktop.
Save MukulLatiyan/7c060afbb8ec0ededd042284b3f5ea2e to your computer and use it in GitHub Desktop.
Multiply Array(GeeksForGeeks)
//Java Code for geeksforgeeks problem named Multiply Array in array section school level.
import java.util.*;
import java.lang.*;
import java.io.*;
class GFG
{
public static void main (String[] args)
{
Scanner s = new Scanner(System.in);
int ntest = s.nextInt();
while (ntest-- > 0){
int size = s.nextInt();
int prod = 1;
for (int i = 0; i < size; i++){
prod *= s.nextInt();
}
System.out.println(prod);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment