This web page requires JavaScript to be enabled.

JavaScript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.

How to enable JavaScript?

Source code chuyển mã Hex ra Bin

10cth1-2 April 6, 2011 2

Đây là đoạn mã đổi từ số có mã Hex ( mã 16) ra mã Bin (mã Nhị phân)
[codes=c]#include
#include

void main()
  {
    int num;
     unsigned int mask;
     // clrscr();
      printf ("Chuong trinh doi so hexa sang nhi phan\n");
      printf ("Nhap vao so hexa :");
      scanf("%x",&num);
      mask = 0x8000;
      printf("\n Dang nhi phan cua so %x la ",num);
      for (int j=1; j<=16; j++)
        {
          printf("%d",mask & num?1:0);
          if (j==4 || j==8 || j==12) printf("-");
          mask >>=1;
      }
      getch();
  } [/codes]


Last modified on March 31st, 2021 at 1:24 am

Nam Le
lequocnam



2 responds

  1. sockcf4 says:

    [emot]shuai[/emot][emot]shuai[/emot][emot]shuai[/emot][emot]shuai[/emot][emot]shuai[/emot][emot]shuai[/emot]

  2. le.qnam says:

    [emot]uplook[/emot]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.