GeekInterview.com
Series: Subject: Topic:
Question: 323 of 827

Write a C program to convert Decimal to Binary conversion without using inbuilt functions

Asked by: shivaram.cunchala | Member Since Jun-2007 | Asked on: Jun 6th, 2007

View all questions by shivaram.cunchala

Showing Answers 1 - 1 of 1 Answers
Syed Baseer Ahmed

Answered On : Jun 8th, 2007

void printBinary(int n){if (n>0){printBinary(n/2);printf("%c","01"[n%2]);}else{printf("n");}}int main(){int num;printf("Enter the number in decimal");scanf("%d",&num);printf("The binary equivalent of %d is  ",num);printBinary(num);getch();return 0;}

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.