Left Shift,left shift in C,program to left shift,left shift the given number,left shift the number,C left shift,write a program to left shift,left shift the given number using C,Write a program to Left Shift the given number using in C language,C language left shift
Left Shift
If you left shift the given number,the given value will become double to actual value.
Suppose the given left shift number is 4(input),output is 8
2(input),output is 4
3(input),output is 6
The above logic is blind way to remember the left shift logic.
Program
#include<stdio.h>
main()
{
int n,ls;
printf("Enter number\n");
scanf("%d",&n);
ls = n << 1;
printf("After left shift : %d\n",ls);
}
Output:
Enter the number
4
After left shift 8
Left Shift
If you left shift the given number,the given value will become double to actual value.
Suppose the given left shift number is 4(input),output is 8
2(input),output is 4
3(input),output is 6
The above logic is blind way to remember the left shift logic.
Program
#include<stdio.h>
main()
{
int n,ls;
printf("Enter number\n");
scanf("%d",&n);
ls = n << 1;
printf("After left shift : %d\n",ls);
}
Output:
Enter the number
4
After left shift 8
cplusplus programming example codes to amateur coders
ReplyDeleteCpu scheduling sample code in c++ language