Docsity

TUTORIAL PROGRAMMING WITH C++ LANGUAGE FOR FRESHMAN EASY, Assignments of Information Technology

Toggle sidebar
bg1
ELLIZA (TEKNIK INFORMATIKA) *2
TUTORIAL BAHASA C++ PEMULA UNTUK MAHASISWA SEMESTER 1
1. OUTPUT KALIMAT
#include <iostream>
using namespace std;
int main (){
cout << " Elisa is a freshman at untirta";
return 0;
}
2. ENTER BISA PAKE <<endl (di luar tanda kutip) atau “\n” (di dalam tanda kutip)
cout << "Elisa is a freshman at untirta" << endl;
cout << "Semester 3 and 4 is a sophomore \n";
cout << "Semester 5 and 6 is a junior";
3. BUAT GAK INPUT KALIMAT PAKAI /* */ atau //
// cout << "Elisa is a freshman at untirta";
/* cout << "Semester 7 and 8 is a senior */;
cout << "Elisa";
OUTPUTNYA NANTI CUMA ELISA AJA
4. HITUNG JUMLAH KATA
int elisa = 5;
cout << elisa;
5. PENJUMLAHAN
#int elisa = 5;
int rara = 4;
int sum = elisa + rara;
cout << sum;
6. INPUT 2 ANGKA, jadi angka satu ada di program, satu lagi input di hasil
#include <iostream>
using namespace std;
int main()
{
int a;
cout << "3 \n";
cin >> a;
cout << a;
return 0;
pf3

Partial preview of the text

Download TUTORIAL PROGRAMMING WITH C++ LANGUAGE FOR FRESHMAN EASY and more Assignments Information Technology in PDF only on Docsity!

ELLIZA (TEKNIK INFORMATIKA) *

TUTORIAL BAHASA C++ PEMULA UNTUK MAHASISWA SEMESTER 1

1. OUTPUT KALIMAT

#include using namespace std; int main (){ cout << " Elisa is a freshman at untirta"; return 0; }

2. ENTER BISA PAKE <<endl (di luar tanda kutip) atau “\n” (di dalam tanda kutip)

cout << "Elisa is a freshman at untirta" << endl; cout << "Semester 3 and 4 is a sophomore \n"; cout << "Semester 5 and 6 is a junior";

3. BUAT GAK INPUT KALIMAT PAKAI /* */ atau //

// cout << "Elisa is a freshman at untirta"; /* cout << "Semester 7 and 8 is a senior */; cout << "Elisa"; OUTPUTNYA NANTI CUMA ELISA AJA

4. HITUNG JUMLAH KATA

int elisa = 5; cout << elisa;

5. PENJUMLAHAN

#int elisa = 5; int rara = 4; int sum = elisa + rara; cout << sum;

6. INPUT 2 ANGKA, jadi angka satu ada di program, satu lagi input di hasil

#include using namespace std; int main() { int a; cout << "3 \n"; cin >> a; cout << a; return 0;

7. PENULISAN ANGKA

#include using namespace std; int main() { int a, b; cout << "1 \n"; cin >> a; cout << "2 \n"; cin >> b; cout << a << "3" << b; return 0; } OUTPUTNYA: 1 2 430 (jadi angka 4 sama 3 nya kebalik)

8. PENGGUNAAN CIN COUT

#include using namespace std; int main (){ int a, b; int sum; cout << " first number = " << endl; cin >> a; cout << " second number = " << endl; cin >> b; sum = a + b; cout << "sum is = " << sum << endl; return 0; } OUTPUT first number = 100 second number = 200 sum is = 300

9. CIN COUT SIMPLE

include