Course Solutions Uncategorized (Solved) : Fix Following Code Print Whether Input Odd Even Include Include Using Namespace Std Int Od Q37505320 . . . .

(Solved) : Fix Following Code Print Whether Input Odd Even Include Include Using Namespace Std Int Od Q37505320 . . . .

 

Fix the following code to print whether the input is odd oreven

#include <iostream>
#include <string>

using namespace std;

int oddOrEven(string x){
if (x % 2 == 0)
return “even”;
else
return “odd”;
}

int main(){
  
int y;
cin >> y;
cout << oddOrEven(y);
  
return 0;
}

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post