#include <stdio.h>
#include <stdlib.h>
float cf(int *c)
{
float fen;
fen = (1.8 * (*c)) + 32;
return fen;
}
int main()
{
float cel, fen;
int c;
printf ("Enter the value of Temperature in Celcius: ");
scanf ("%f", &cel);
fen = cf(&c);
printf ("The value of Temperature in Fahreinheit is: %.2f", fen);
system("PAUSE");
return 0;
}
@OP(original poaster): Please use code tags.
Your errors:
-You did not end the definition of function cf
-You called it wrongly
#include <stdio.h>
#include <stdlib.h>
float cf(int *cal)
{
float fen;
fen = (1.8 * (*cal)) + 32;
return fen;
}
int main()
{
float c;
printf ("Enter the value of Temperature in Celcius: ");
scanf ("%f", &c);
printf ("The value of Temperature in Fahreinheit is: %.2f\n", cf(&c));
system("PAUSE");
return 0;
}
#include <iostream>
usingnamespace std;
int main()
{
double celcius;
double far;
int x=10;
do{
system("CLS");
cout<<"Please enter a value to be converted to fahrenheit: ";
cin>>celcius;
far=celcius*9/5+32;
cout<<"\nAns: "<<far;
cout<<"\n\n\t\t\t\t\t\t\t\tContdown: "<<x-1;
x--;
cin.ignore();
cin.get();
} while(x!=0);
}