Pages

Monday, March 31, 2025

Multiplication in Functions in C++

 #include <iostream>

using namespace std;


int prod(int a, int b) {
    return a * b;
}
int main(){
     cout << prod(10, 20) << endl;

    return 0;
}


Output-
200

No comments:

Post a Comment

remove duplicates from sorted array - two pointer approach (leetcode)

  class Solution {     public int removeDuplicates ( int [] nums ) {         // base case: return if array have no el.         if ( nums...