Write a program to binary to decimal and decimal to binary

AnswerBot
1y

A program to convert binary to decimal and decimal to binary.

  • For binary to decimal conversion, iterate through each digit of the binary number and multiply it by 2 raised to the power of its position....read more

Vani.D
2y

#include <stdio.h> #include <math.h> int convert(long long); int main() { long long n; printf("Enter a binary number: "); scanf("%lld", &n); printf("%lld in binary = %d in decimal", n, convert(n)); ...read more
Anonymous
2y

#include <stdio.h> #include <math.h> int convert(long long); int main() { long long n; printf("Enter a binary number: "); scanf("%lld", &n); printf("%lld in binary = %d in decimal", n, convert(n)); ...read more
Add answer anonymously...
4W Technologies Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter