this program takes 2 numbers and addts the 2nd number to the first 10 times, each time showing the result.Code:#include <iostream.h> int main() //*this program basicly takes 2 numbers and adds them together { //*10 times (every time showing the result) int a; //*declaring var's int x; int z; cout<<"enter offset to calculate:"; //asks for the first number cin>>a; //stores first number in var "a" cout<<"enter diffrence:"; //asks for the 2nd number cin>>z; //stores 2nd number in var z for(int x=0;x<10;x++) //a loop to make the code block loop 10 times { a=a+z; cout<<"this is the result"<< a<<endl; } cin.get(); //for some reason in order to make the program stay open cin.get(); //and not close right after its finished i had to use return 0; // cin.get() twice :| }
the problam is i want those 2 numbers to be hex values, if i try to write the value as hex the program crashes, can anyone point me to the right direction? (note: im a newb i love oyur site tutorials )