Google Translate

English French German Spain Italian Dutch

Russian Brazil Japanese Korean Arabic Chinese Simplified
Translate Widget by Google

Rabu, 12 Oktober 2011

Coding C++

^^ Coding Bintang^^

#include
#include
main()
{
clrscr();
int n,i,j;
char ulang;

cout << " ===================================================== \n";
cout << " + Membuat Segitiga yang di putar 90 derajat + \n";
cout << " ==================================================== \n \n";
cout << endl;
cout << endl;



//Menampilakan segitiga dari 1 sampai n
for (i = 1; i<=n;i++)
{
for (j = 1; j<=i;j++)
cout << "*";
cout << endl;
}

//menampilakan bagian yang merupakan pencerminan dari setengah segitiga pertama
for (i=n-1;i>=1;i--)
{
for (j=1;j<=i;j++)
cout << "*";
cout << endl;
}
getch();
}


^^ Coding Angka-Angka Teks^^

#include
#include

int angka;

main()
{
cout << " ==================================================== \n";
cout << " + Program Konversi Angka Ke Teks + \n ";
cout << " ==================================================== \n";
cout<<<"Input Angka 1-10 : "; //Input angka oleh user
cin>>angka;
clrscr();

cout<<<" (Satu)";
break;
case 2:cout<<" (Dua)";
break;
case 3:cout<<" (Tiga)";
break;
case 4:cout<<" (Empat)";
break;
case 5:cout<<" (Lima)";
break;
case 6:cout<<" (Enam)";
break;
case 7:cout<<" (Tujuh)";
break;
case 8:cout<<" (Delapan)";
break;
case 9:cout<<" (Sembilan)";
break;
case 10:cout<<" (Sepuluh)";
break;
default:
cout<<" Data Salah...!!!";
cout<<<"Angka yang di Input Lebih Besar";
break;
}
cout<<<<<" [ copyright By Gladys (TM) ]";

getch();
}

0 komentar:

Posting Komentar