Basic Language Understanding Environment Script

Basic Language Understanding Environment Script

Share

Providing basic programming using cplusplus java etc. under Ubuntu Linux OS

Photos 01/06/2016

Lesson 3 - Control structures : Part 1 - if and switch

Terminal command: go inside the directory of the .cpp file
type g++ vardatatypes.cpp -o lesson2.out then press enter.
after pressing enter, type ./lesson2.out. then your done.

Note: I am using space after the # because in facebook this represents for hashtag. But in your actual programming. Please don't put spaces in that part.

Source code:
# include /**header file: this is a class on a library that allows you to perform inputs and outputs. The IO on iostream means Input Output**/
using namespace std;

int main(){ //Ex*****on of your program always starts at your main
int a = 5;

//if statement
if(a == 5){
//if condition is true
cout

Photos 01/06/2016

Lesson 2 - Variables and Data types

Terminal command: go inside the directory of the .cpp file
type g++ vardatatypes.cpp -o lesson2.out then press enter.
after pressing enter, type ./lesson2.out. then your done.

Note: I am using space after the # because in facebook this represents for hashtag. But in your actual programming. Please don't put spaces in that part.

Source code:

# include /**header file: this is a class on a library that allows you to perform inputs and outputs. The IO on iostream means Input Output**/
using namespace std;

int main(){ //Ex*****on of your program always starts at your main

int a = 10; //declaring variable a as an integer
bool b = false; //declaring variable b as a boolean which holds 0 or 1 / true or false;
string holder = "coding"; //declaring variable holder as a string
char s = 'r'; //declaring variable s as a character

//integer
cout

Photos 01/06/2016

First of all you need a text editor: I am using Sublime Text 3.

Lesson 1 - Printing Hello World on your screen

Terminal command: go inside the directory of the .cpp file
type g++ helloworld.cpp -o helloworld.out then press enter.
after pressing enter, type ./helloword.out. then your done.

Note: I am using space after the # because in facebook this represents for hashtag. But in your actual programming. Please don't put spaces in that part.

Source code:
# include /**header file: this is a class on a library that allows you to perform inputs and outputs. The IO on iostream means Input Output**/
using namespace std;

int main(){ //Ex*****on of your program always starts at your main

cout

Want your school to be the top-listed School/college in Davao City?

Click here to claim your Sponsored Listing.

Location

Category

Website

Address


Davao City
8000