Can someone help me out with my program?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • FaisalAl
    New Member
    • Oct 2008
    • 1

    Can someone help me out with my program?

    Write a complete program that inputs 2 integers from "cin" and uses "cout" to print the word "yes" if both numbers are even , otherwise the program outputs "no"

    #include <iostream>
    using namespace std;
    int main()
    {
    int x;
    int y;
    cout<< "input 1st value" << endl;
    cin>> x;
    cout<< "input 2nd value" << endl;
    cin>> y;
    if(???????????? ???????????);
    {
    cout << "YES" << endl;
    }
    else
    {
    cout <<"NO" << endl
    }
    }

    HELP ME
  • oler1s
    Recognized Expert Contributor
    • Aug 2007
    • 671

    #2
    I'm not going to give you the answer outright (because I want you to learn to think and break down problems).

    First, whenever you post code, use CODE tags. Surround your code with [ CODE] and [/ CODE] (without the space inside).

    So tell us, precisely, what the problem is. You have something you cannot write the code for.

    How would you solve the problem with pen and paper?

    Comment

    • shakeel225
      New Member
      • Sep 2008
      • 4

      #3
      [ spoonfeeding code deleted ]

      kind regards,

      Jos (moderator)

      Comment

      • boxfish
        Recognized Expert Contributor
        • Mar 2008
        • 469

        #4
        Originally posted by oler1s
        Surround your code with [ CODE] and [/ CODE] (without the space inside).
        If you want to show off the code tags, try writing them as [CO[B][/B]DE] so they show up normally.
        [CODE] [/CODE]

        Originally posted by FaisalAl
        if(???????????? ???????????);
        Do you know how to test whether a number is even?

        Comment

        Working...