Subscribe to Feeds

Send Your COMPLETED Projects To georgepj@hotmail.com

We'll Publish It With Your Name :-)

Programs Can Also Be Downloaded From The Folders Below....[Or Scroll Down]

Showing posts with label Conversions. Show all posts
Showing posts with label Conversions. Show all posts

Height to Yard,Feet & Inches

Click Here To Download C++ File Of This Program

 //prg to ask your height & convert into feet & inches  
//Downloaded From www.c4cpp.co.nr. (C)2009.All rights reserved.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float h,i,f;
cout<<"Enter your heught in cms :"<<endl;
cin>>h;
f=h/30.48;
cout<<"Height in feets :"<<f<<endl;
i=h/2.54;
cout<<"Height in inch :"<<i<<endl;
getch();
}

Celcius To Farenheit

Click Here To Download C++ File Of This Program

 //prg to read temp in celsius & display in F  
//Downloaded From www.c4cpp.co.nr. (C)2009.All rights reserved.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float k,c;
cout<<"Enter the temp in Celsius :";
cin>>c;
k=(9/5)*c+32;
cout<<"Temperature in Farenheit = "<<k;
getch();
}

Decimal To Binary & vice versa

Click Here To Download C++ File Of This Program

 //prg to conv decimal to binary & binary to decimal 
//Downloaded From www.c4cpp.co.nr. (C)2009.All rights reserved.
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int a,g,h,s=0,i=0,d,b,ch;
cout<<endl<<"Enter the choice - "<<endl<<"1:Binary to Decimal"<<endl<<"2:Decimal to Binary"<<endl;
cin>>ch;
switch(ch)
{
case 1:
cout<<"Enter the Binary Digit"<<endl;
cin>>b;
while(b>0)
{
a=b%10;
s=s+a*(pow(2,i));
i=i+1;
b=b/10;
}
cout<<"Answer ="<<s<<endl;
break;
case 2:
cout<<"Enter the Decimal"<<endl;
cin>>d;
while(d>0)
{
a=d%2;
a=a*pow(10,i);
s=s+a;
i=i+1;
d=d/2;
}
cout<<"Answer ="<<s<<endl;
break;
default:
cout<<"Wrong choice"<<endl;
break;
}
getch();
}

Binary To Octal & Vice Versa

Click Here To Download C++ File Of This Program

 //prg to conv decimal to binary & binary to decimal 
//Downloaded From www.c4cpp.co.nr
//(C)2009.All rights reserved.
#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<process.h>
void main()
{
clrscr();
int aa,g,h,s=0,ii=0,dd,b,ch;
men :
cout<<endl<<"Enter the choice - "<<endl<<endl<<"1:Binary to Decimal"<<endl<<endl<<"2:Decimal to Binary"<<endl;
cout<<endl<<
"3:Binary to Octal"<<endl<<endl<<"4:Octal to Binary"<<endl<<endl<<"5:exit"<<endl<<endl;;
cin>>ch;
switch(ch)
{
case 1:
s=0;
ii=0;
cout<<"Enter the Binary Digit"<<endl;
cin>>b;
while(b>0)
{
aa=b%10;
s=s+aa*(pow(2,ii));
ii=ii+1;
b=b/10;
}
cout<<"Answer ="<<s<<endl;
goto men;
case 2:
s=0;
ii=0;
cout<<"Enter the Decimal"<<endl;
cin>>dd;
while(dd>0)
{
aa=dd%2;
aa=aa*pow(10,ii);
s=s+aa;
ii=ii+1;
dd=dd/2;
}
cout<<"Answer ="<<s<<endl;
goto men;
case 3:
int oc,sum,p,r,n,a,i=0,x=0,d=0,j,o;
cout<<"ENTER THE BINARY DIGIT :"<<endl;
cin>>b;
while(b>0)
{
a=b%1000;
j=0;
d=0;
while(a>0)
{
n=(a%10);
d=d+(n*pow(2,j));
j=j+1;
a=a/10;
}
x=x+(d*pow(10,i));
i=i+1;
b=b/1000;
}
cout<<"Answer ="<<x;
goto men;
case 4:
cout<<"Enter the Octel"<<endl;
cin>>oc;
i=0;
j=0;
sum=0;
s=0;
while(oc>0)
{
p=oc%1000;
while(p>0)
{
r=p%2;
s=s+r*pow(10,j);
j++;
p=p/2;
}
sum=sum+(s*pow(1000,i));
i++;
oc=oc/10;
j=0;
}
cout<<"Binary ="<<sum;
goto men;
case 5:
exit(0);
default:
cout<<"Wrong choice"<<endl;
}
getch();
}