So chuffed guys i got it made a bad mistake in the print functions both were using the kilometers function to convert. Here's the finished code.
Code:
#include<stdio.h>
double kilometres( double m )
{
return m * 1.609344 ;
}
double miles( double km )
{
return km * 0.621371192 ;
}
int main( void )
{
float a ;
float b ;
char c, d ;
printf( "Do you wish to convert m or km?\n") ;
scanf( "%c%c", &c, &d) ;
if( c == 'k' && d == 'm' )
{
printf( "Y number of km converted to m:\n") ;
scanf( "%f", &b ) ;
printf( "= %f km\n", miles((float) b)) ;
}
else
{
printf( "X number of m converted to km:\n") ;
scanf( "%f", &a ) ;
printf( "= %f km\n", kilometres((float) a)) ;
}
return 0 ;
}
Thanks again! =]