Convert 11001100 in two's complement representation (in 8 bits) to a base ten integer.
1
2012-09-21T10:15:57-0400
#include "iostream.h"
#include "math.h"
void main(){
int c [8] = { 1, 1, 0, 0, 1, 1, 0, 0 };
int a = 0;
for (int i=0; i<=7; i++)
& a += c[i]*pow(2,i);
cout<<a<<"\n";
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments