Saturday, May 25, 2019

hexa decimal number in c programming

//program 1

#include <stdio.h>
int main()
{
int arr[]={0x78, 0x78};
int i;

printf("Array elements are\n");
for(i=0;i<2;i++)
printf("Hex: %X\n",arr[i]);

return 0;
}


//program 2

#include <stdio.h>
int main()
{
unsigned char a=0x64;
int b=0xFA;

printf("value of a: %X [%x]\n",a,a);
printf("value of b: %X [%x]\n",b,b);

return 0;
}

No comments:

Post a Comment

python class topic video