Berikut Source-nya:
#include <string>
#include <iostream>
#include <conio.h>
#include <windows.h>
void chgcolor(unsigned short color)
{
HANDLE sCon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(sCon, color);
}
using namespace std;
int main() {
try
{
char NamaL[20], TempatL[20], Sekolah[20], Kelas[10], Hobi[20];
chgcolor(4);
cout << "=========== Enter These Questions ============";
cout << "\n\n";
chgcolor(15);
cout << "Nama Lengkap: "; cin.getline(NamaL, 20);
cout << "Tempat Lahir: "; cin.getline(TempatL, 20);
cout << "Sekolah: "; cin.getline(Sekolah, 20);
cout << "Kelas: "; cin.getline(Kelas, 10);
cout << "Hobi: "; cin.getline(Hobi, 20);
cout << "========== R E S U L T ! ==============";
cout << "\n\n";
cout << "Nama Lengkap: " << NamaL << endl;
cout << "Tempat Lahir: " << TempatL << endl;
cout << "Sekolah: " << Sekolah << endl;
cout << "Kelas: " << Kelas << endl;
cout << "Hobi: " << Hobi << endl;
cout << "\n\n" << endl;
cout << "Thanks For Your Attention! :)" << endl;
_getch();
return 0;
}
catch (exception e)
{
cout << e.what();
}
}
0 Comments
Berkomentarlah secara baik dan sopan tanpa ada unsur SARA dan juga penghujatan.