Saturday, April 9, 2011

Given an Array A, calculate Array B, where B[i] contains the product of all values of Array A except A[i]

Input:
6 5 4 1 2


Output:
Printing the input Array:
6 5 4 1 2
Printing B:
1 6 30 120 120
Printing C:
40 8 2 2 1
Result Array values:
40 48 60 240 120


Code:

No comments:

Post a Comment