#include<stdio.h>
#include<conio.h>
void main()
{
int n,rem=0,j,i=0,dec[20],temp;
clrscr();
printf("\n\t\tThe Software creadet by Dixit Panchal\n");
printf("\t\tEnter Your decimal Value \n\n");
scanf("%d",&n);
temp=n;
while(n>0)
{
rem=n%2;
n/=2;
dec[i]=rem;
i++;
}
printf("\nYour Decimal number is %d",temp);
printf("\nAnd binary is ");
for(j=i-1 ;j>=0;j--)
{
printf("%d",dec[j]);
}
getch();
}
#include<conio.h>
void main()
{
int n,rem=0,j,i=0,dec[20],temp;
clrscr();
printf("\n\t\tThe Software creadet by Dixit Panchal\n");
printf("\t\tEnter Your decimal Value \n\n");
scanf("%d",&n);
temp=n;
while(n>0)
{
rem=n%2;
n/=2;
dec[i]=rem;
i++;
}
printf("\nYour Decimal number is %d",temp);
printf("\nAnd binary is ");
for(j=i-1 ;j>=0;j--)
{
printf("%d",dec[j]);
}
getch();
}
No comments:
Post a Comment