#include<protos.h>
void main()
{
long int offset;
clrscr();
printf("Enter byteoffset : ";
cin>>offset;
int b_offset;
int single=-1,doubles=-1,triples=-1;
long int block=offset/1024;
if(block < 266)
{ single=block;
b_offset=offset%1024;
goto SKP;
}
else if(block > 266 && block < 65802)
{ single=block/256;
doubles=block%256-10;
b_offset=offset%1024;
goto SKP;
}
else if(block > 65802 && block<10000000)
{ single=block/(256*256);
long int temp=block%(256*256);
doubles=temp/256;
triples=temp%256;
b_offset=offset%1024;
}
SKP:
printf("\n%d %d %d %d single,doubles,triples,b_offset);
getch();
}
c program codes for beginner code writers
3D graphic example code in C language