--- On Tue, 8/17/10, Borris <[email protected]> wrote:


From: Borris <[email protected]>
Subject: [c-prog] C++, Can anyone help me what's wrong of my program...tnx
To: [email protected]
Date: Tuesday, August 17, 2010, 6:54 AM


  



// Function to convert dollars to pesos using function. 1$ = 46.00 
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>

//declaration
void head( );
float convert (float);

main() //main
{
float dollar, peso;
head();
printf ("\n\tPlease enter the dollar: $"); scanf ("%.2f",&dollar);
peso = convert(dollar);                   <<-----------   HERE IS THE ERROR
printf("\n\n\t\t$%.2f is equal to PH%.2f pesos.", dollar, peso);
getch();
}

void head ()
{ 
printf ("\n\t\t<<Function to convert dollars to pesos using function.>>\n"); 
}
float convert(float d)
{ 
float p;
p = 1*46; //computation to convert dollar to peso
return (main); // returns the value of p to main function
} 









      

[Non-text portions of this message have been removed]

Reply via email to