Pengenalan int dan char
Halaman 1 dari 1
Pengenalan int dan char
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;
#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 : 33
Registration date : 02.03.09
Halaman 1 dari 1
Permissions in this forum:
Anda tidak dapat menjawab topik
|
|