Minggu, 23 Maret 2014

Pertemuan 04. E-Book Displaying a Celsius-to-Fahrenheit Conversion Table

 #include <cstdlib>
#include <iostream>
#define cbegin 10
#define climit -5
#define cstep 5
using namespace std;

int main(int argc, char *argv[])
{
    int celcius;
    double fahrenheit;
   
    cout<<"Celcius \tFahrenheit"<<endl<<endl;
   
    for (celcius=cbegin;celcius>=climit;celcius -= cstep) {
        fahrenheit= 1.8*celcius+32.0;
        cout<<"celcius "<<celcius<<"\tfahrenheit "<<fahrenheit<<endl;
        }
       
    system("PAUSE");
    return EXIT_SUCCESS;
}

BAHASA C++ RUN

Tidak ada komentar:

Posting Komentar