Clean Coding – Which of these functions in the given code snippet depicts a lazy code smell…


Which of these functions in the given code snippet depicts a lazy code smell?

#include <iostream>

using namespace std;
int remainder(int a, int b) //Fun1
{
  return(a % b);
}
  
int add(int a, int b) //Fun2
{
    return (a + b);
}

int multiply(int a, int b) //Fun3
{
  return (a * b);
}

int main() 
{

  int sum;
    sum = add(100, 78);
    cout << "100 + 78 = " << sum << endl;
    mul = multiply(10, 78);
    cout << "10 * 78 = " << mul << endl;
    return 0;
}

Related Posts

Close Bitnami banner
Bitnami