Results 1 to 2 of 2

Thread: Macro to exchange the nibbles

  1. #1
    Contributing Member
    Join Date
    Apr 2007
    Answers
    41

    Macro to exchange the nibbles

    Can anybody provide me a code for
    Macro to exchange the nibbles??

    regards
    Prakash


  2. #2
    Junior Member
    Join Date
    Jul 2007
    Answers
    18

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact