Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

expected a ";" What should i do?

#include <iostream>

using namespace std;


void mamusomtijebal()
{
    int main()
    {
        float vaha = 0;
        cout << "Zadaj svoju vahu" << endl;
        cin >> vaha;
    }

    if (vaha => 80) {
        cout << "Ty velryba";
    }

    if (vaha <= 70) {
        cout << "Skeleton pojebany";
    }
}

I am new to c++ and this is my problem i don’t see anything wrong with my code what should i do?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

int main should be outside, not inside any function–in your case, mamusomtijebal().

Also, the operator is >=, not =>.

Use this code:

#include <iostream>

using namespace std;


int main() {
    float vaha = 0;
    cout << "Zadaj svoju vahu" << endl;
    cin >> vaha;
    
    if (vaha >= 80) {
        cout << "Ty velryba" << endl;
    } else if (vaha <= 70) {
        cout << "Skeleton pojebany" << endl;
    }
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading