Pengenalan int dan char

Topik sebelumnya Topik selanjutnya Go down

Pengenalan int dan char

Post  midun on Fri Jul 17, 2009 1:46 pm

using namespace std;
#include <iostream>

int main()
{
int a; // a is an integer variable
char s [100]; // s points to a string of max 99 characters

cout << "This is a sample program." << endl;

cout << endl; // Just a line feed (end of line)

cout << "Type your age : ";
cin >> a;

cout << "Type your name: ";
cin >> s;

cout << endl;

cout << "Hello " << s << " you're " << a << " old." << endl;
cout << endl << endl << "Bye!" << endl;

return 0;

midun

Jumlah posting : 3
Age : 25
Registration date : 02.03.09

Lihat profil user

Kembali Ke Atas Go down

Topik sebelumnya Topik selanjutnya Kembali Ke Atas


 
Permissions in this forum:
Anda tidak dapat menjawab topik