C Programming

Program to demonstrate example of right shift (>>) operator.

Program to demonstrate example of right shift (>>) operator.
#include <stdio.h>
 
int main()
{
 
    unsigned int num= 0xff;
 
    printf("\nValue of num = %04X before right shift.",num);
 
   
    num = (num>>2);
    printf("\nValue of num = %04X after right shift.",num);
 
    return 0;
}
Nikhil Juneja

Passionate software developer and technical contributor at TutorialsLink.