(10%)
Determine whether the following code is correct or not. If it is
correct, predict its output. If it is incorrect, point out the
mistake(s).
// binary to decimal
#include <iostream>
using std::cout;
using std::endl;
int main()
{
char b[] = "01000100";
int i;
for (i=0; i<8; i++)
b[i] -= '0'; // ASCII code of '0' is 48.
for (i=0; i<=6; i++)
b[i+1] = b[i]*2 + b[i+1];
cout << static_cast<short>(b[7]) << endl;
return 0;
}