PROBLEM LINK:
Author: Vidya Kale
Tester: Vidya Kale
Editorialist: Vidya Kale
DIFFICULTY:
CAKEWALK.
PREREQUISITES:
None .
PROBLEM:
You are given integer N. You have to check whether a number is even or odd.
QUICK EXPLANATION:
If integer number is given to you then find out it is even or odd.
EXPLANATION:
Check Integer number is even or odd and print it in output.
SOLUTIONS:
Setter's Solution
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
if(n%2==0){
cout<<"even"<<endl;
}
else{
cout<<"odd"<<endl;
}
}
return 0;
}
Tester's Solution
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
if(n%2==0){
cout<<"even"<<endl;
}
else{
cout<<"odd"<<endl;
}
}
return 0;
}
Editorialist's Solution
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
if(n%2==0){
cout<<"even"<<endl;
}
else{
cout<<"odd"<<endl;
}
}
return 0;
}