How will i convert this binary code"10110111" into decimal value?
I have used the following codes

#include <stdio.h>

main()
{
	int n,track,sum,num;

	printf("number:                     ");
	scanf("%d%d%d%d%d%d%d%d%d%d%d", &n1, &n2, &n3, &n4, &n5, &n6, &n7, &n8, &n9, &n10, &n11);

	
	{
		sum=0;
		num='n1'*2+'n1';
		sum=sum+num;
	}
	
}

Recommended Answers

All 2 Replies

Your code is copy/paste.
It's not even a valid C code.

How will i convert this binary code"10110111" into decimal value?
I have used the following codes

Did your code work? If not, what happened? What value did you input? What value was output? How can you tell it didn't work?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.