C to MIPS

  • Thread starter Thread starter dangehe
  • Start date Start date
D

dangehe

Guest
int number, counter, mask;



printf("Enter an integer in decimal number system\n");

scanf("%d", &number);

printf("%d in binary number system is:\n", number);

mask = 1;

for (counter = 31; counter >= 0; counter --)

{

int temp = number >> counter;



if ((temp & mask) == 1)

printf("1");

else

printf("0");

}

Continue reading...
 
Back
Top