Decimal to Binary using while statement in C program
//using while statement #include<stdio.h> #include<conio.h> main() { int n,m,r,p=1,t=0; printf("Enter any decimal number:"); scanf("%d",&n); m=n; while(n!=0) { r=n%2; t=t+(r*p); n=n/2; p=(p*10); } printf("Decimal Number %d=Binary Number:%d",m,t); } DECIMAL To BINARY …
Decimal to Binary using while statement in C program Read More