Anda Pengunjung Ke :

Rabu, 05 Oktober 2011

program menghitung jarak tempuh

 Ini adalah program jarak tempuh yang mana mengunakan while  . . . hehehehe


#include<iostream.h>
 #include<conio.h>
                                    main()
                                    {
                                          int s, a=10, t=1;
                                          while (t <=5)
                                          {
                                                s=0.5*a*(t*t);
                                                cout<<"Jarak yang ditempuh dalam "<<t<<" detik = "<<s<<" meter"<<endl;
                                                t++;
                                          }
                                          getch();
                                    }

Monggo di copas

0 komentar:

Posting Komentar

Twitter Delicious Facebook Digg Stumbleupon Favorites More