Advertisement
Guest User

Template

a guest
Oct 22nd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. <dataType> multiplication(int n, dataType* array){
  2.     dataType res = 1;
  3.     for (int i = 0; i < n; i++) {
  4.         if (array[i] != 0)
  5.             res *= array[i];
  6.     }
  7.     return res;
  8. }
  9. dataType = int | float | double
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement