can this thing below work?????

{#include<iostream.h>
#include<conio.h>
#include<stdio.h>
char value;
char t, u, v;
char answer;
void Binary2Decimal()
{
switch(t){
case 'a':                                            //ok
cout<<endl<<"[BINARY TO DECIMAL CONVERSION]"<<endl;
cout<<endl;
long b2,f2=1,d2=0;
cout<<"Enter a Binary number: ";
cin>>b2;
cout<<"\n\n";
while(b2>0)
{
if((b2%10)==1)
{
d2=d2+f2;
}
b2=b2/10;
f2=f2*2;
}
cout<<"Decimal equivalent is: "<<d2<<endl;
break;
default:
cout<<endl;
}
break;
}
void Octal2Decimal()
{
case 'b':
cout<<endl<<"[OCTAL CONVERSION]"<<endl;
cout<<endl;
cout<<"a - Decimal"<<endl;
cout<<endl;
cout<<"Convert to: ";
cin>>u;
switch(u){
case 'a':                                      //ok
cout<<endl<<"[OCTAL TO DECIMAL CONVERSION]"<<endl;
cout<<endl;
long number4,dec7,rem7,i7,sum7;
cout<<"Enter an Octal number: ";
scanf("%o", &number4);
cout<<"\n\n";
dec7=printf("%d", number4);
{
rem7=dec7%8;
sum7=sum7 + (i7*rem7);
}
printf("Decimal equivalent is: %d", number4);
break;
default:
cout<<endl;
}
break;
}
void Hexa2Decimal()
{
case 'c':
cout<<endl<<"[HEXADECIMAL CONVERSION]"<<endl;
cout<<endl;
cout<<"a - Decimal"<<endl;
cout<<endl;
cout<<"Convert to: ";
cin>>v;
switch(v){
case 'a':                                     //ok
cout<<endl<<"[HEXADECIMAL TO DECIMAL CONVERSION]"<<endl;
cout<<endl;
long number1,dec8,rem8,i8=1,sum8=0;
cout<<"Enter a Hexadecimal number: ";
scanf("%X", &number1);
cout<<"\n\n";
dec8=printf("%d", number1);
{
rem8=dec8%16;
sum8=sum8 + (i8*rem8);
}
printf("Decimal equivalent is: %d", number1);
break;
default:
cout<<endl;
}
break;
}
int main()
{
do{
clrscr();
cout<<"Conversion from any base to base 10"<<endl;
cout<<endl;
cout<<"a - Binary"<<endl;
cout<<"b - Octal"<<endl;
cout<<"c - Hexadecimal"<<endl;
cout<<endl;
cout<<"Select a value to be converted: ";
cin>>value;
switch(value){
case 'a':
cout<<"[BINARY CONVERSION]"<<endl;
cout<<endl;
cout<<"a - Decimal"<<endl;
cout<<endl;
cout<<"Convert to: ";
cin>>t;
Binary2Decimal();
Octal2Decimal();
Hexa2Decimal();
default:
cout<<endl;
}
cout<<endl;
cout<<"Do you want to continue NUMBER CONVERSION?(y/n) ";
cin>>answer;
}
while(answer == 'y');
cout<<endl;
}

The way you're formated this makes it hard to read, esps specailly to a reletivly new hobbyist programmer like me; this needs to change ASAP. You're also trying to distribute a switch across mutiple functions, whtch is a total no-no. The rest of it: Jesus.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.