How to divide any number with 256 without using arithmetic operator?
Solution:
#include<stdio.h>
#include<conio.h>
int main()
{
int num;
printf("Enter any number:");
scanf("%d",&num);
printf("After number divided by 256 = %d ",num>>8);
getch();
}
Explanation:
How this code work?
For this you should know about >> operator. This is
right shift operator. Now num>>8 means to shift number 8 binary character
to right. Because 2 8 represent 256 in binary.