Contoh Program C++

Posted: May 3, 2011 in Bahasa C++

Syntax dibawah ini merupakan contoh nilai dalam variabel yang sudah di berikan langsung dan setelah itu ditampilkan kembali nilai tersebut,,,,..

#include <iostream.h>
#include <conio.h>

using namespace std;

int main()
{
// Inisialisasi Variabel

float a,b,c;

// Pemberian Nilai Variabel
a=10;
b=1;
c=20;

// Menampilkan Kembali Nilai
cout << “Nilai A : “<<a<<endl;
cout << “Nilai B : “<<b<<endl;
cout << “Nilai C : “<<c<<endl;
system(“pause”);
return 0;
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s