PROGRAM TO CONVERT DECIMAL TO BINARY


#include<stdio.h>
#include<conio.h>
void main()
{
long int n=0,i=0,nos=0,p=1;
clrscr();
printf("enter a number\n");
scanf("%ld",&n);
while(n>0)
{
i=n%2;
nos=nos+i*p;
p=p*10;
n=n/2;
}
printf("%ld",nos);
getch();
}

SIMPLE PROGRAMS
FUNCTIONS


NUMBERS


STRINGS AND CHARACTERS

Comments