## even or odd number c++ || class program

even or odd number class program: In this program find the entered number is Even number or Odd number. Which number is divisible by 2 is known as an even number, and which number is not divisible by 2 is known as an odd number. Program: #include<iostream>using namespace std;class even{ int n,i;public: void read(); void print();};void … Read more even or odd number c++ || class program

## Print even numbers in c++ || using class

Print even numbers in c++: Even numbers are the numbers which are divisible by 2 that type number is known as Even numberRemember this 2 point for(i=0;i<n;i++)if(i%2==0) Program: #include<iostream>using namespace std;class even{int n, i;public:void read();void print();};void even::read(){cout<< “enter the number you want to print even number”;cin>>n;cout<<“even number of size”<<n<<“isn”;}void even::print(){for(i=0;i<n;i++)if(i%2==0)cout<<i<<“n”;}int main(){even ob1;ob1.read();ob1.print();} Output: Click  Here … Read more Print even numbers in c++ || using class