#include<stdio.h>
int main()
{
int L,H,num,B,rem,base,i;
printf("Enter lower range:");
scanf("%d",&L);
printf("Enter higher range:");
scanf("%d",&H);
for(i=L;i<=H;i++)
{
B=0;
base=1;
num=i;
while(num>0)
{
rem=num%2;
B=B+rem*base;
num=num/2;
base=base*10;
}
printf("\nBinary equivalent of %d is :%d",i,B);
}
return 0;
}
***Input && Output***
0 Comments