0
How do i receive an integer and return true if is greater than or equal to zero; or false otherwise?
the fuction is esPostivo()
2 Réponses
+ 1
OlVeRaS94HD
bool esPostivo(int num)
{
if(num >= 0)
{
return true;
}
else
{
return false;
}
}
0
int num;
cin >> num;
if(num >= 0){
return true;
}else{
return false
}