Paren neparen

    0

    0

    The code prints the following:

    vnesi za a: 0 vnesi za b: 1 vnesi za y: 2

    #include <iostream>
    using namespace std;
    
    int main()
    {
    
      int a,b,y;
      cout << "vnesi za a: ";
      cin >> a;
      cout << "vnesi za b: ";
      cin >> b;
      if ((a % 2) != 0)
      {
        y = a + b;
        cout << y;
      }
      else
      {
        y = a - b;
        cout << y;
      }
      return 0;
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.