• Cursussen
  • Code Compiler
  • Discussiëren
  • Prijzen
  • Teams
Menu
+ 1

How do i make cin to recognize only numbers?

2
18th Apr 2023, 7:14 PM
Jasubu Ishaya
2 Antwoorden
+ 1
With this method: int num; cin >> num; num gets the user's number. If the input is not a number (like string), num value is 0
18th Apr 2023, 8:07 PM
Ugulberto Sánchez
Ugulberto Sánchez - avatar

Heb je vaak vragen zoals deze?

Leer efficiënter, gratis:

  • Inleiding tot Python

    7,1 miljoen leerlingen

  • Inleiding tot Java

    4,7 miljoen leerlingen

  • Inleiding tot C

    1,5 miljoen leerlingen

  • Inleiding tot HTML

    7,5 miljoen leerlingen

Bekijk alle cursussen
Populair vandaag
How my gradient is so mess I code in vscode and copied here to ask some questions please help me with this one too
1 Votes
HELP ME LEARN
1 Votes
Please tell me about methods
1 Votes
Does anyone know how to go to another "page" on the same page using the HTML button tag?
2 Votes
I am beginner in CS, how I learn C++?
0 Votes
Can I learn both graphic design and web development at the same time?
0 Votes
How do i learn php in here?
1 Votes
Hi everyone I hope you’re well
0 Votes
Running of python or js script (backend) and entering of html page by clicking SUBMIT button
2 Votes
Inserting Images
1 Votes