This is the program which convert binary number to decimal.
In case you need the above code or more questions with solution click on this link :
https://programmingbykhushboo.blogspot.com/2018/12/conversion-of-binary-to-decimal-program.html
There is a slight mistake in the above code . I have written two times the same code and that extra if statement actually there is no need of that.
Thanks