type="text/javascript">

Sabtu, 29 Maret 2014

5.4 Figure 5.8 Displaying a Celsius-to-Fahrenheit Conversion Table

 Program C++ nya : 

#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 fahrenhait;
   
    cout<<" Celcius \t Fahrenhait"<<endl;
    cout<<endl;
   
    for(celcius=cbegin;celcius>=climit;celcius-=cstep){
    fahrenhait=1.8*celcius+32.0;
    cout<<"celcius  "<<celcius<<"\tfahrenhait "<<fahrenhait<<endl;
    }
   
    system("PAUSE");
    return EXIT_SUCCESS;
}

#Screenshot nya :

Tidak ada komentar:

Posting Komentar