#include<conio.h> #include<stdio.h> int binary(int); void main() { int num; clrscr(); printf("\nEnter the number"); scanf("%d",&num); binary(num); getch(); } int binary(int num) { int r; r=num%2; num=num/2; if(num==0) { printf("\nThe binary euivalent is %d",r); } else { binary(num); printf("%d",r); return(r); } }
No comments:
Post a Comment