## 23.11.14

### Excercise-13 : Find ODD or EVEN

Write a c++ program to check whether the given number is odd or even

1. #include

using namespace std;

int main()
{
int n;
cout<<"enter a number:";

cin >>n ;

if(n%2==0)

cout<<"The given number is even ";
else

cout<<"The given number is odd";

}

1. 2. This comment has been removed by the author.

1. Why did you removed ? Is there any problem ?

2. Yes Sir
After submit comments program auto change that I cannot understand. What should to remove this problem. Please sir advice me.

3. There are some spam in your computer. Try using another browser or pc.

4. http://itlearn24.blogspot.com/2014/11/find-odd-or-even.html

3. This comment has been removed by the author.

1. Why did you removed ? Is there any problem ?

4. #include
using namespace std;
int check(int a);
main()
{
int a;
cout<<"enter the number:"<>a;
check(a);
}
int check(int q)
{
if(q%2==0)
cout<<"this is an even number";
else
cout<<"this is an odd number";
}

1. noted and found correct

5. #include
using namespace std;
int number (int l);
main()
{
int l;
cout<<"Enter the number:";
cin>>l;
number(l);
}
int number (int n)
{
if (n%2==0)
cout<<"/n The number is even";
else if(n%2==1)
cout<<"/n The number is odd";
}

1. Noted. Found Correct

2. use profile picture

6. Name-Main Uddin
ID-201421090
Batch-46
Any integer is input by the user. Write a program to find out whether it is an odd number or even number.

#include
#include
using namespace std;

int main()
{
int a;
cout<<"Enter any number : ";
cin>>a;
if(a%2==0)
cout<<"The number is even";
else
cout<<"The number is odd";

getch();
return 0;
}

1. noted. found correct

7. yeasmin akter
ID:201420271
Bach:46
#include
#include
using namespace std;

class yeasmin
{
public:
int i, n;
void get_value()
{

cout<<"Enter the namber";
cin>>n;
}
void get_cal()
{
for(i=1;i<=n;i++)
{
if(i%2==0)
sum+=i;
}
}
protected:
int sum;
};
class tamanna:public yeasmin
{
public:
void display()
{
cout<<"The sum of even number";
}
};
int main()
{
tamanna Esa;
Esa.get_value();
Esa.get_cal();
Esa.display();
}

1. 8. Md. Khairul Hasan
Batch: 46th
ID No: 201420529

#include
#include
using namespace std;

class masum
{
public:
int n,i;
void get_value()
{
cout<<"Enter the number:";
cin>>n;
}
void get_cal()
{
for(i=1;i<=n;i++)
{
if(i%2==0)
sum+=i;
}
}
protected:
int sum;
};

class hasan:public masum
{
public:
void display()
{
cout<<"The sum of even number";
}
};

int main()
{
hasan khairul;
khairul.get_value();
khairul.get_cal();
khairul.display();
}

1. 9. ID-201420406
Batch-46th

#include
using namespace std;
int main()
{

int number;

cout << "Enter any integer: ";
cin >> number;

if(number % 2 ==0)
cout << number << " is even number.";
else
cout << number <<" is odd number.";

return 0;

}

10. Batch-46th
Id_201420405
#include
using namespace std;

int main()
{
int a;
cout<<"Enter any number : ";
cin>>a;

if(a%2==0)
cout<<"The number is even";
else
cout<<"The number is odd";

cin.ignore();
cin.get();
return 0;
}

11. Name-M.R.Awal Hossain
ID-201421092
Batch-46
#include
#include
using namespace std;

int main()
{
int i;
cout<<"Input Number : ";
cin>>i;
if(i%2==0)
cout<<"even Number";
else
cout<<"odd Number";

getch();
return 0;
}

12. Habibur Rahman
batch 46th
ID: 201421091

#include

using namespace std;

int main()
{
int X;
cout<<"input number:";

cin >>X ;

if(X%2==0)

cout<<"number is even ";
else

cout<<"number is odd";
}

13. #include
using namespace std;
int check(int x);
main()
{
int x;
cout<<"enter the number:";
check(x);
}
int check(int m)
{
if(m%2==0)
cout<<"this is an even number";
else
cout<<"this is an odd number";
}

14. #include
using namespace std;

void even_odd(int n)
{
if(n%2==0)
cout<<"Enter number is Even";
else
cout<<" nter number is Odd";
}

int main()
{
int n;
cout<<"Enter number to check Even or odd ";
cin>>n;
even_odd(n);
return 0;
}

15. nazmul alam
201420674
46th
#include

int main(void)
{
int x;
for (x = 0; x < 10; x++)
if (x % 2)
printf("%d is odd\n", x);
return 0;
}

/* and.c */
#include

int main(void)
{
int x;
for (x = 0; x < 10; x++)
if (x & 1)
printf("%d is odd\n", x);
return 0;
}

16. 201420674
#include
using namespace std;
int check(int a);
main()
{
int a;
cout<<"enter the number:"<>a;
check(a);
}
int check(int q)
{
if(q%2==0)
cout<<"this is an even number";
else
cout<<"this is an odd number";
}

17. CSE-46(Dip)
ID=201420656

#include
using namespace std;

void Even-Odd(int v)
{
if(v%2==0)
cout<<"the number is Even";
else
cout<<" the number is Odd";
}

int main()
{
int v;
cout<<"the number is check Even or Odd";
cin>>v;
Even-Odd(v);
Return 0;
}

18. #include
using namespace std;
int main()
{
int num;
for(num=5;num<50;num++)
{
if(num%2==0)
{
cout<<"Even numbers "<<endl;
cout<<num<<endl;
}
else
{
cout<<"Odd numbers "<<endl;
cout<<num<<endl;
}
}
}

19. md.Abul kashem
roll-201410856

#include
using namespace std;
int number (int l);
main()
{
int l;
cout<<"Enter the value:";
cin>>l;
number(l);
}
int value (int n)
{
if (n%2==0)
cout<<"/n The value is even";
else if(n%2==1)
cout<<"/n The value is odd";
}

20. ID : 201510545
https://www.dropbox.com/s/394qzy9ja0i9c7n/ODDofEVEN.cpp?dl=0

Comment Here