kali ini saya akan membahas tentang konversi hari ::
langsung saja
#include <cstdlib>
#include <iostream>
#include <string.h>
using namespace std;
int main(int argc, char *argv[])
{
dikurr:
cout<<"===================================\n";
cout<<" Menghitung Jarak 2 Titik\n";
cout<<" Dian Kurniawan \n";
cout<<" 1300018156/D\n";
cout<<"====================================\n\n";
int hari_ke;
char*hari;
cout<<"masukkan hari_ke-";cin>>hari_ke;
switch(hari_ke){
case 1: strcpy(hari," hari senin ");break;
case 2: strcpy(hari," hari selasa ");break;
case 3: strcpy(hari," hari rabu ");break;
case 4: strcpy(hari," hari kamis ");break;
case 5: strcpy(hari," hari jum'at ");break;
case 6: strcpy(hari," hari sabtu ");break;
default:strcpy(hari," hari minggu ");break;
}
cout<<" >>> hari_ke-"<<hari_ke<<" adalah "<<hari<<endl;
cout<<endl;
cout<<endl;
goto dikurr;
system("PAUSE>>null");
return EXIT_SUCCESS;
}
0 komentar:
Posting Komentar