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. . . . .