Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to find binary of number?

Answer Posted / kamalb008

#include<stdio.h>
main()
{
int a,i,b,n;/*i have taken arbitary base u can enter the
base what ever u need*/
printf("enter the number and the base u want to conv resp");
scanf("%d%d",&a,&n);
i=1;
while(i<=20)
{
if(a<n)
break;
b=a%n;
a=a/n;
printf("\nLSB%d of the converted number is %d",i,b);
i++;
}
printf("\nMSB of the conv is %d",a);
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can a function argument have default value?

1147


What are the advantages of the functions?

1158


What is "Hungarian Notation"?

1107


what do the 'c' and 'v' in argc and argv stand for?

1166


Can an array be an Ivalue?

1090


What is a ternary operator in c?

1120


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

1097


Write a program to check whether a number is prime or not using c?

1058


Define circular linked list.

1027


What does %p mean c?

1063


What is the difference between variable declaration and variable definition in c?

1058


How do you define CONSTANT in C?

1268


show how link list can be used to repersent the following polynomial i) 5x+2

2297


Explain the difference between structs and unions in c?

1020


Why header file is used in c?

1092