C++

for(int i=0;(i<A.size()-1);i++) { mul = mul*A[i]; }

because

**it multiply all number of the vector but the last one**.

Quote:I want to find the number of distinct prime number of a given number

Can you define this ?

Because as I understand it, it is not what is doing your code, it- is not even close.

As I understand it, your code return a list of all prime numbers below

`mul`

.Complete your code so it can be run.

Show an input example that give you the error message.

"I am getting BUS ERROR for some test cases"What test cases, and where do you get the error?

I want to find the number of distinct prime number of a given number,2.

I am passing a array to the function and then multiplying all the elements of the array to generate the number,How are sentences (1) and (2) related?

Write some test data, include more output and use the debugger.