Sample – convert temperatures

by Nideesh C on February 8, 2011 · 0 comments

in C++




#include <iostream.h>

float f (float x) {
return ((9.0 / 5.0) * x + 32.0);
}

void main () {
float x, res;

cout << “Enter x: “;
cin >> x;
res = f(x);
cout << “Result = ” << res << endl;
}

Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. Sample – factorial
  2. Sample – Fibonacci numbers
  3. Sample program (multiplication using addition)
  4. Sample – exponentiation using multiplication
  5. Sample – count number of characters and lines in a file

Leave a Comment

Previous post:

Next post: