---
title: "Discussion on \"Program to convert a binary number to a decimal number in C.\" | Hashnode"
description: "Discussion on \"Program to convert a binary number to a decimal number in C.\". include<stdio.h>\nint main( ) \n{ int n,nsave,rem,d,j=l,dec=O;\n  printf(\"Enter the number in binary :\"); \n  scanf (\"%d\", &n) ;\n  nsave=n; \nwhile (n>O)\n { \n    rem=n%lO; /*Itaking last digit1 */\n    d=rem*j; \n    dec+=d; \n    j*=2; \n    n/=lO; /*skippin..."
url: "https://hashnode.com/posts/program-to-convert-a-binary-number-to-a-decimal-number-in-c/63d0bee606135d9d89b5ce37"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Program to convert a binary number to a decimal number in C.](https://himanshu-holmes.hashnode.dev/program-to-convert-a-binary-number-to-a-decimal-number-in-c?utm_source=hashnode&utm_medium=feed)

include<stdio.h> int main( ) { int n,nsave,rem,d,j=l,dec=O; printf("Enter the number in binary :"); scanf ("%d", &n) ; nsave=n; while (n>O) { rem=n%lO; /\*Itaking last digit1 \*/ d=rem\*j; dec+=d; j\*=2; n/=lO; /\*skippin...

Jan 25, 2023 · 1 min read · himanshu-holmes.hashnode.dev  
Read the article

-   [#c](https://hashnode.com/tag/c)

## Written by

[Himanshu-holmes](https://hashnode.com/@Himanshu00holmes)

@Himanshu00holmes · India

  
[View profile](https://hashnode.com/@Himanshu00holmes)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
