lundi 2 août 2021

Always returns a "1" or "0" at the end

I am new to C++ and am trying to learn how to use if statements and boolean variables. every time I compile there's always a "1" or "0" at the end of the print. i was wondering if this is normal, or if there's something I did wrong, I notice that the 1 always appears when the value is true, and the 0 always appears when it is false. Here is my code...

    #include <iostream>
#include <cmath>
using namespace std;

int meeting(bool sus){
    if (sus){cout << "you are a sussy player";}
    else{cout << "you are a crewmate";}
    return sus;

}

int main (){
    cout << meeting(false);
    return 0;
}

and here is what the compiler says...

you are a crewmate0
Process returned 0 (0x0)   execution time : 0.726 s
Press any key to continue.

if I change the value to true then this is what it says...

you are a sussy player1
Process returned 0 (0x0)   execution time : 0.473 s
Press any key to continue.

Thank You.

Aucun commentaire:

Enregistrer un commentaire