Menu

Need help in a code for homework

Nickod
2011-01-25
2012-09-26
  • Nickod

    Nickod - 2011-01-25

    C++ bloodshed obviously

    I have no clue what to do. I am assigned to make a console app. with 3 ways to
    add by 1, and 3 ways to subtract by 1. I tried making my own source code but
    since I was not provided an example by my teacher, It does not work as
    intended. I was unable to build from anything.
    any idea how to make it work?

    I am using Dev-C++ from Bloodshed

    include <cstdlib>

    include <iostream>

    using namespace std;

    int main(int argc, char *argv)
    { int Num1 = Num1 + 1;
    cout <<" enter a variable \n";
    cin >> Num1;
    cout <<" your number plus 1 is " << Num1=Num1+1 << "";
    cout << endl;
    int Num2 + = 1;
    cout <<"enter another variable \n";
    cin >> Num2;
    cout <<" your number plus 1 is " << Num2+=1 << "";
    cout << endl;
    int Num3 ++;
    cout <<"enter another variable \n";
    cin >> Num3;
    cout <<" your number plus 1 is " << Num3++ << "";
    cout << endl;
    int Num4 = Num1 - 1;
    cout <<" enter a variable \n";
    cin >> Num4;
    cout <<" your number plus 1 is " << Num4=Num4-1 << "";
    cout << endl;
    int Num5 - = 1;
    cout <<"enter another variable \n";
    cin >> Num5;
    cout <<" your number plus 1 is " << Num5-=1 << "";
    cout << endl;
    int Num6 --;
    cout <<"enter another variable \n";
    cin >> Num6;
    cout <<" your number plus 1 is " << Num6-- << "";
    cout << endl;
    system("PAUSE");
    return 0;
    }

     
  • Nickod

    Nickod - 2011-01-25

    Never mind I fixed it with an online manual.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.