Hello, I’m having some problems with my program, the loop variable when tested at first works fine then after input of a new value output is unexpected.
#include <iostream>
using namespace std;
int main(){
int inputOne;
int arrayLoop;
int quotientValue=0;
int arrayMain[99];
cout<<"ENTER NUMBER TO CONVERT: ";
cin>>inputOne;
for(arrayLoop=0; quotientValue>=0 ; arrayLoop++){
while (inputOne>=2){
inputOne-=2;
quotientValue++;
} cout<<"QUOTIENT IS: "<<quotientValue<<endl;
cout<<"BINARY IS: "<<inputOne<<endl;
arrayMain[arrayLoop]=inputOne;
cout<<"Enter new quotient: ";
cin>>inputOne;
}
while(arrayLoop>=0){
arrayLoop=arrayLoop-1;
cout<<arrayMain[arrayLoop];
}
return 0;
}