ok here is the code:
i just want it to divide SUM ( which is t1+t2 ) by the div1 which is the number the user inputs..... can anyone help me why does it keep saying is 0?Code:#include <iostream> using namespace std; int main() { int t1; int t2; int sum; int div; int div1; int divided; { int t1; cout<<" this will add 2 values of test grades you have entered" <<endl; cout<<"enter the value of the first test " <<endl; cin>> t1; cin.ignore(); cout<<"You enetered " << t1 << endl; int t2; cout<<"enter the value of the second test " <<endl; cin>> t2; cin.ignore(); cout<<"you have entered " << t2 << endl; // simple cacl by J-C int sum; cout<<"THIS IS THE SUM " << t1 + t2 << endl; int div; cout<<"ENter the number you want to be divided by " <<endl; cin>> div; cin.ignore(); cout<<" you have entered " << div << "press enter to see the answer" <<endl; } { int div1; div1 = ( sum / div ); cin.ignore(); } { int divided; cout<<"the answer is " << divided << endl; cin.ignore(); } }




Reply With Quote