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

Why is c called c?

956


Can an array be an Ivalue?

1055


What is clrscr ()?

1056


What is a program flowchart and how does it help in writing a program?

1082


Why c is faster than c++?

979


Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?

1014


What are pointers really good for, anyway?

1013


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

1950


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1227


Write a program to reverse a string.

1025


what value is returned to operating system after program execution?

2062


When would you use a pointer to a function?

993


How to declare pointer variables?

1165


Sir i need notes for structure,functions,pointers in c language can you help me please

2350


Why is structure important for a child?

1049