-
Contributing Member
Macro to exchange the nibbles
Can anybody provide me a code for
Macro to exchange the nibbles??
regards
Prakash
-
Junior Member
Re: Macro to exchange the nibbles
hi..frnd
here i have written one program to exchange the byte for 2 byte variable..
from this you can derive for the nibble:
#include<conio.h>
#include<stdio.h>
void swapNibble(int);
void main()
{
short int x;
printf("sizeof int = %d",sizeof(x));
printf("Enter the value:");
scanf("%d",&x);
swapNibble(x);
getch();
}
void swapNibble(int var)
{
var = var << 8;
printf("\nvalue after shifting the var is = %d",var);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules