mirror of
https://inf-git.fh-rosenheim.de/studavrije7683/cplusplus-training.git
synced 2025-04-19 22:49:55 +00:00
36 lines
550 B
C++
36 lines
550 B
C++
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
int main(int argc, char** argv) {
|
|
float celsius[10];
|
|
float fahrenheit;
|
|
float tmp;
|
|
int schrittweite = 10;
|
|
int i = 0;
|
|
|
|
cout << "Fahrenheit: ";
|
|
cin >> fahrenheit;
|
|
tmp = fahrenheit;
|
|
|
|
cout << endl;
|
|
|
|
for(i = 0; i < 10; i++)
|
|
{
|
|
celsius[i] = ((fahrenheit - 32) * 5) / 9;
|
|
fahrenheit += schrittweite;
|
|
}
|
|
|
|
i = 0;
|
|
fahrenheit = tmp;
|
|
|
|
while(i < 10)
|
|
{
|
|
cout << "Fahrenheit: " << fahrenheit << "\t| Celsius[" << i << "]: " << celsius[i] << endl;
|
|
fahrenheit += schrittweite;
|
|
i++;
|
|
}
|
|
return 0;
|
|
}
|
|
|