Is this correct? The code .

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

void Menu();
void BinToDec();
void DecToBin();
void OctToDec();
void DecToOct();
void HexToDec();
void DecToHex();

int main()
{
Menu();
void BinToDec();
void DecToBin();
void OctToDec();
void DecToOct();
void HexToDec();
void DecToHex();
return 0;
}

void Menu()

{
int Choice;

do
{
system ("cls");
printf("\n\n\t\tEG1005 MiniProject 02 Operations");
printf("\n\t\t==================================");
printf("\n\t\tProject Operations:");
printf("\n\t\t 1. Binary to Decimal Conversion ");
printf("\n\t\t 2. Decimal to Binary Conversion ");
printf("\n\t\t 3. Octal to Decimal Conversion ");
printf("\n\t\t 4. Decimal to Octal Conversion ");
printf("\n\t\t 5. Hexadecimal to Decimal Conversion ");
printf("\n\t\t 6. Decimal to Hexadecimal Conversion ");
printf("\n\t\t 7. Quit");

printf("\n\t\t Please enter your selection:");
Choice = getche();

switch (Choice)
{
case'1': void BinToDec(); break;
case'2': void DecToBin();break;
case'3': void OctToDec();break;
case'4': void DecToOct();break;
case'5': void HexToDec();break;
case'6': void DecToHex();break;
case'7': break;
default: printf("\n\t Selection not available");
_sleep(2000);

}

}

while (Choice != 7);
printf("\n\t End of programme");
printf("\n\t");
system ("pause");

}

Last edited on
You have not declared defined BinToDec() anywhere
Last edited on
You never defined the function BinToDec(). Forward declaration of this function won't be enough, this will cause an error at the link stage.
Topic archived. No new replies allowed.