Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Division par 0 #1

Open
pierrbt opened this issue Aug 23, 2022 · 0 comments
Open

Division par 0 #1

pierrbt opened this issue Aug 23, 2022 · 0 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@pierrbt
Copy link
Contributor

pierrbt commented Aug 23, 2022

J'ai trouvé une erreur dans main.cpp pour la fonction division :

void division() 
 { 
  
     float nb1; 
     float nb2; 
     cout << "Entrez le premier nombre : "; 
     cin >> nb1; 
     cout << "\nEntrez le deuxieme nombre : "; 
     cin >> nb2; 
     float rep = nb1 / nb2; 
     cout << endl << nb1 << " / " << nb2 << " est egal a " << rep; 
 }

Ça ne vérifie pas que nb2 != 0 donc si on met 0, le programme va faire une erreur.

@pierrbt pierrbt added bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed labels Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants