Limelight Forums
Coding! - Printable Version

+- Limelight Forums (https://limelightgaming.net/forums)
+-- Forum: Entertainment (https://limelightgaming.net/forums/forum-197.html)
+--- Forum: Off-Topic (https://limelightgaming.net/forums/forum-208.html)
+--- Thread: Coding! (/thread-14900.html)



Coding! - Ilias S. - Mar 29, 2017

Hey there! Here are some programs that i have made on C++, still learning though. What programs have you made? Feel free to post them!

Code:
#include <iostream>

using namespace std;

int main()
{
    char x;
    int a; int b; int c; int m;
    cout << "Give a name." << endl;
    cin >> x;
    cout << "Give 3 Numbers." << endl;
    cin >> a >> b >> c;
    m=(a+b+c)/3;
    cout << "O mesos oros einai: " << m << endl;
    if (m<14)
    {
        cout << "Bad." << endl;
    }
    else if (m<14 && m>16)
    {
        cout << "Metrios." << endl;
    }
    else if (m>16 && m<18)
    {
        cout << "Good." << endl;
    }
    else if (m>18)
    {
        cout << "Perfect." << endl;
    }
    return 0;
}

Code:
#include <iostream>

using namespace std;

int main()
{
    int a; int b;
    char x;
    cout << "Dose 2 Arithmous." << endl;
    cin >> a >> b;
    cout << "Dose 1 epilogi." << endl;
    cin >> x;
    if (x=='P')
    {
        cout << "Epilogi: Prosthesi." << endl;
        cout << "Caculating..." << endl;
        cout << "Result: " << a+b << endl;
    }
    else if (x=='A')
    {
        cout << "Epilogi: Aferesi." << endl;
        cout << "Caculating..." << endl;
        cout << "Result: " << a-b << endl;
    }
    else if (x=='L')
    {
        cout << "Epilogi: Polaplasiasmos." << endl;
        cout << "Caculating..." << endl;
        cout << "Result: " << a*b << endl;
    }
    else if (x=='D')
    {
        cout << "Epilogi: Dieresi." << endl;
        cout << "Caculating..." << endl;
        cout << "Result: " << a/b << endl;
    }
    else
    {
        cout << "Invalid Parameter." << endl;
    }
    return 0;
}

What do you think?