Fatihul Ulum Community of Knowledge
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Pengenalan int dan char

Go down

Pengenalan int dan char Empty Pengenalan int dan char

Post  midun 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
midun

Jumlah posting : 3
Age : 33
Registration date : 02.03.09

Kembali Ke Atas Go down

Kembali Ke Atas


 
Permissions in this forum:
Anda tidak dapat menjawab topik