#include<stdio.h>
int main()
{
int n, j, anik[1000];
int i = 0;
printf("Enter any number : ");
scanf("%d", &n);
while(n != 0)
{
anik[i] = n%2;
n = n/2;
i++;
}
printf("Binary Number : ");
for(j=i-1; j>=0; j--)
{
printf("%d", anik[j]);
}
return 0;
}
int main()
{
int n, j, anik[1000];
int i = 0;
printf("Enter any number : ");
scanf("%d", &n);
while(n != 0)
{
anik[i] = n%2;
n = n/2;
i++;
}
printf("Binary Number : ");
for(j=i-1; j>=0; j--)
{
printf("%d", anik[j]);
}
return 0;
}
Comments
Post a Comment