0
My program isnt running please give suggestions
#include <iostream> using namespace std; int main() { int v,h; cout<< "enter number of valence electrons"; cin>>v; if(v<=8){ h=v/2; } else{ h=v/8+(v%8)/2; } if(h=2){ cout<<"sp Hybridization"; } else if(h=3){ cout<<"sp² Hybridization"; } else if(h=4){ cout<<"sp³ Hybridization"; } else if(h=5){ cout<<"sp³d Hybridization"; } else if(h=6){ cout<<"sp³d² Hybridization"; } else if(h=7){ cout<<"sp³d³ Hybridiz
5 Réponses
+ 13
Complete revision
#include <iostream>
using namespace std;
int main() {
int v,h;
cout << "enter number of valence electrons: ";
cin >> v;
if (v <= 8) h = v / 2;
else h = v / 8 + (v % 8) / 2;
if (h == 2) cout << "sp Hybridization\n";
else if (h == 3) cout << "sp^2 Hybridization\n";
else if (h == 4) cout << "sp^3 Hybridization\n";
else if (h == 5) cout << "sp^3 d Hybridization\n";
else if (h == 6) cout << "sp^3 d^2 Hybridization\n";
else if (h == 7) cout << "sp^3 d^3 Hybridiz\n";
}
Feel free and ask your questions.
+ 5
if(something == otherthing)
+ 3
What!?
0
1 more question
0
how can I make it's output