Pages
Home
C++/C- Programs
DOS Commands
BS Communication
Mathematics
Advertisement
About Us
Contact us
Sunday, December 9, 2012
WAP to print Decimal to Binary 25
#include<stdio.h>
#include<conio.h>
void main()
{
long int no,rem=0,base=1,number=0,i;
clrscr();
printf("enter yhr number:");
scanf("%d",&no);
while(no!=0)
{
rem=no%2;
no=no/2;
base=base*10;
number+=rem*base;
i++;
}
printf("%ld",number);
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment