Full width home advertisement

Post Page Advertisement [Top]

#include<conio.h>
#include<stdio.h>
int main()
{
int no,v,r,i=1,b=0;
printf("Please enter decimal number");
scanf("%d",&no);
v=no;
while(no!=0)
{
   r=no%2;
   no=no/2;
   b=b+(r*i);
   i=i*10;
}
printf("binary value is =%d",b);
getch();

}

OutPut

No comments:

Post a Comment

Bottom Ad [Post Page]

| Designed by Colorlib