Right Shift,right shift in C,program to right shift,right shift the given number,right
shift the number,C right shift,write a program to right shift,right shift
the given number using C,Write a program to right Shift the given number
using in C language,C language right shift
Right Shift
If you Right shift the given number,the given value will become half to actual value.
Suppose the given Right shift number is 2(input),output is 1
6(input),output is 3
9(input),output is 4
The above logic is blind way to remember the left shift logic.
#include<stdio.h>
main()
{
int n,ls;
printf("Enter number\n");
scanf("%d",&n);
ls = n >> 1;
printf("After Right shift : %d\n",ls);
}
Output:
Enter the number
10
After Right shift 5
Right Shift
If you Right shift the given number,the given value will become half to actual value.
Suppose the given Right shift number is 2(input),output is 1
6(input),output is 3
9(input),output is 4
The above logic is blind way to remember the left shift logic.
#include<stdio.h>
main()
{
int n,ls;
printf("Enter number\n");
scanf("%d",&n);
ls = n >> 1;
printf("After Right shift : %d\n",ls);
}
Output:
Enter the number
10
After Right shift 5
0 comments:
Post a Comment