Hi@all;
I think I don't need to write explanation about my code because it is very easy.
Can anyone tell me when I run my prog. why the prog. gives me correct answer only once and after that doesn't give the correct answers for others?
I know what is wrong but I don't know how to correct it? How can I divide each element in my array to 100 and print them?
Code:
#include <iostream>
using namespace std;
int main()
{
int array[2];
for (int i=0; i<2; i++)
cin >>array[i];
for (int j=0; j<2; j++)
cout <<array[j]/100<<endl;
return 0;
}
Thanks