Need help with C++ tryg to do input validation with loops and its not working. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Need help with C++ tryg to do input validation with loops and its not working.

include <iostream> using namespace std; void Limelight(){ cout<<"What is the value of a human being?"<<endl; } int Hinata(){ int value; cout<<"Pick a value between -10 and 10!"<<endl; cin>>value; return value; } int main() { Limelight(); int dab = Hinata(); do{ if(dab>=-10||dab<=10){ cout<<"I cannot believe humans are rated so low!"<<endl; cout<<"That explains everything bad in the world!"; } else cout<<"Good Morning and goodbye"; }while(!dab); return 0; }

30th Oct 2019, 3:28 AM
Angelica
Angelica - avatar
2 Answers
0
#include <iostream> using namespace std; void Limelight(){ cout<<"What is the value of a human being?"<<endl; } int Hinata(){ int value; cout<<"Pick a value between -10 and 10!"<<endl; cin>>value; return value; } int main() { Limelight(); int dab = Hinata(); do{ if(dab>=-10&&dab<=10){ cout<<"I cannot believe humans are rated so low!"<<endl; cout<<"That explains everything bad in the world!"; } else cout<<"Good Morning and goodbye"; }while(!dab); return 0; }
30th Oct 2019, 3:37 AM
jak Leito
jak Leito - avatar
0
thanks
30th Oct 2019, 3:29 PM
Angelica
Angelica - avatar