ในโปรแกรมนี้ เราจะมาดูวิธีการแปลงเซลเซียสเป็นฟาเรนไฮต์โดยใช้ C++ อย่างที่เราทราบสูตรนั้นง่าย

อัลกอริทึม
Begin Take the Celsius temperature in C calculate F = (9C/5)+32 return F End
โค้ดตัวอย่าง
#include<iostream>
using namespace std;
main() {
float f, c;
cout << "Enter temperature in Celsius: ";
cin >> c;
f = (9.0*c/5.0)+32;
cout << "Equivalent Fahrenheit temperature is: " << f;
} ผลลัพธ์
Enter temperature in Celsius: 37 Equivalent Fahrenheit temperature is: 98.6