Write a C program to convert binary to decimal using function.
#include<stdio.h> #include<conio.h> #include<math.h> int bin_to_dec(int); main() { int n,result; printf("\n Enter any binary number"); scanf("%d",&n); result=bin_to_dec(n); printf("\n The equivalant decimal=%d",result); getch(); } int bin_to_dec(int x) { int i=0,digit,sum=0; do { digit=x%10; sum=sum+digit*pow(2,i); x=x/10; i++; }while(x!=0); return(sum); }
Output:
Write short note on
Iridium satellite system
What is Resource management?
Write a C program to find the factorial of any number.
Difference between ISO and CMM standards.