create a program that will accept 1 input number then display the even numbers base from the inputted number
#include <iostream>
using namespace std;
int main() {
int number;
cout<<"Enter number: ";
cin>>number;
cout<<"\nAll the even numbers:\n";
for(int i=0;i<=number;i++){
if(i%2==0){
cout<<i<<"\n";
}
}
cin>>number;
return 0;
}
Comments
Leave a comment