Skip to main content

Menampilkan Bintang * dengan C++


Menampilkan Bintang

Berikut ini adalah program C++ untuk menampilkan bintang sebagai berikut:

*
**
***
****
*****


Listing program:


#include

#include

void main()
{
int bar, kol;
clrscr();
bar=1;
while (bar<=5) { kol=1; while(kol<=bar) { cout <<”*”; kol++; } cout <<”\n”; bar++; } getch(); } Bila tampilannya dirubah seperti berikut ini: * ** *** **** ***** **** *** ** * Maka listing programnya sebagai berikut: #include

#include

void main()
{
int baris, kolom, batas;
clrscr();
baris=1;
while(baris<=9) { if (baris<=5) batas=baris; else batas=baris-(baris-5)*2; kolom=1; while(kolom<=batas) { cout […]




Comments

Popular posts from this blog

Membuat website dengan CodeIgniter Part1

Langsung aja saya jabarkan kebutuhan yg akan di pakai nanti untuk membuat sebuah website d ari framework codeigniter... pertama.. ya tentu saja source dari codeigniter-nya... bisa pake yg terbaru atau 2.0 ++ disini kedua.. database -nya bisa menggunakan MySql yg udah di bundle ke dalam Xampp disini ketiga (optional) Editor teks.... pake notepad oke... pake netbeans oke juga... Langkah selanjutnya adalah install terlebih dahulu xampp-nya jika sudah ada xamppnya, lanjut ke langkah selanjutnya, lalu kemudian extract source Codeigniter di htdocs xampp. berikut susunan direktori Codeigniter root dir....         .../application                   .../cache                   .../config                   .../controllers      ...

A history of Einstein

Around 1886 Albert Einstein began his school career in Munich. As well as his violin lessons, which he had from age six to age thirteen, he also had religious education at home where he was taught Judaism. Two years later he entered the Luitpold Gymnasium and after this his religious education was given at school. He studied mathematics, in particular the calculus, beginning around 1891.  In 1894 Einstein's family moved to Milan but Einstein remained in Munich. In 1895 Einstein failed an examination that would have allowed him to study for a diploma as an electrical engineer at the Eidgenössische Technische Hochschule in Zurich. Einstein renounced German citizenship in 1896 and was to be stateless for a number of years. He did not even apply for Swiss citizenship until 1899, citizenship being granted in 1901.  Following the failing of the entrance exam to the ETH, Einstein attended secondary school at Aarau planning to use this route to enter the ETH in Zurich. While at Aarau he wr...

A history of Ir. Soekarno

Sukarno This is an Indonesian name; it does not have a family name  Ir. Sukarno 1st President of Indonesia In office 18 August 1945 – 12 March 1967 Prime Minister Sutan Sjahrir Amir Sjarifuddin Muhammad Hatta Abdul Halim Muhammad Natsir Soekiman Wirjosandjojo Wilopo Ali Sastroamidjojo Burhanuddin Harahap Djuanda Kartawidjaja Vice President Mohammad Hatta Succeeded by Suharto Born 6 June 1901 Blitar, Dutch East Indies Died 21 June 1970 (aged 69) Jakarta, Indonesia Political party None Spouse Oetari Inggit Garnasih Fatmawati Hartini Kartini Manoppo Ratna Sari Dewi Soekarno Haryati Yurike Sanger Heldy Djafar Religion Islam Signature  Sukarno, born Kusno Sosrodihardjo (6 June 1901 - 21 June 1970) was the first President of Indonesia. He helped the country win its independence from the Netherlands and was President from 1945 to 1967, presiding with mixed success over the country's turbulent transition to independence. Sukarno was forced out of power by one of his generals, Suharto, who ...