Finding Binary Equivalent Using Math Function in C Tamil


/* www.tutorjoes.com */
// Binary Equivalent
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
	int num,n,r,i=0;
	long double bin=0;
	clrscr();	// Clears the output Screen
	printf("\n Enter the Number :");
	scanf("%d",&num);
	n=num;
	while(n!=0)
	{
		r=n%2;      	// www.tutorjoes.com
		n=n/2;
		bin=(pow(10,i)*r)+bin;	      //	pow(10,i)
		i++;
	}
	printf("\n Binary Equivalent of %d is %2.0Lf",num,bin);
	getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming