Write a program that will let the user enter the number and then it will output "even" if the number is even, and "odd" if the number is odd. Example output 1: Enter the number: 369 The number is odd. Example output 2: Enter the number: 866 The number is even. (Must be done in Code::Blocks C++)
Open codeblocks
then go to file->new->empty file
write this code there
#include<bits/stdc++.h>
using namespace std;
int main()
{
//prompt the user to enter the number
cout<<"Enter the number:";
int n;
cin>>n;
//if n leaves remainder with 2 then n is odd
if(n%2)
{
cout<<"The number is odd"<<endl;
}
//else n is even
else
{
cout<<"The number is even"<<endl;
}
}
save the file with .cpp extension
press f9 to compile and run



Write a program that will let the user enter the number and then it will output...