23.11.14

Excercise-13 : Find ODD or EVEN


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

32 comments:

  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";


    }

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

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

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

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

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

      Delete
  3. This comment has been removed by the author.

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

      Delete
  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";
    }

    ReplyDelete
  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";
    }


    ReplyDelete
  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;
    }

    ReplyDelete
  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();
    }

    ReplyDelete
    Replies
    1. your answer is not matched with the question. answer in proper place.

      Delete
  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();
    }

    ReplyDelete
    Replies
    1. This is not a proper answer for this question. Place your answer under a proper question.

      Delete
  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;

    }

    ReplyDelete
  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;
    }

    ReplyDelete
  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;
    }

    ReplyDelete
  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";
    }

    ReplyDelete
  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";
    }

    ReplyDelete
  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;
    }

    ReplyDelete
  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;
    }

    ReplyDelete
  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";
    }

    ReplyDelete
  17. Mohammad Ashraful Hasan sobuj
    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;
    }

    ReplyDelete
  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;
    }
    }
    }

    ReplyDelete
  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";
    }

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

    ReplyDelete

Comment Here