Tag Archives: c
TEA BREAK WITH C++: VARIABLES
Since we learned basic input function at programming with C++, we need to talk a little more about the variables.
Variables are simply naming some data location in your pc. With variables you can store a value.
Continue reading TEA BREAK WITH C++: VARIABLESTEA BREAK WITH C++: Basic Input & endl
On line 9 in the previous example we give
int firstNumber, secondNumber, sum;
We define integer variables. These are first number with the definition firstNumber, and the second number defined as secondNumber. And the sum. These we defined as integer by writing “int” at the beginning.
Continue reading TEA BREAK WITH C++: Basic Input & endlTEA BREAK WITH C++ : Basic Comment Section for All programs
NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/
Here these lines are comment section giving information about the program, and you need to include these lines so that another programmer can understand what it is about easily.
Continue reading TEA BREAK WITH C++ : Basic Comment Section for All programsTEA BREAK WITH C++: Basic Comment Section for All programs
NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/
Here these lines are comment section giving information about the program, and you need to include these lines so that another programmer can understand what it is about easily.
Continue reading TEA BREAK WITH C++: Basic Comment Section for All programsTEA BREAK WITH C++: BASIC INPUT / OUTPUT
NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/
As we have seen in the previous section, library we are using for basic input / output operations is the iostream library. That is why we need to include that at the beginning.
Continue reading TEA BREAK WITH C++: BASIC INPUT / OUTPUTTEA BREAK WITH C++: MY FIRST C++ PROGRAM
NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/
- //my first c++ program
- #include <iostream>
- using namespace std;
- int main(){
- cout<<“hello world!”;
- return 0;
- system(“pause”);
- }
- /* This ends
- the file */
TEA BREAK WITH C++: Paragraph Comments (Multiple Line Comment)
NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/
Another type of comment is paragraph comment (or multiple line comment) where you start commenting with “*/” and end with “/*”
Continue reading TEA BREAK WITH C++: Paragraph Comments (Multiple Line Comment)TEA BREAK WITH C++: Line Comments
NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/
The “//” sign means you are adding a comment. This is called line comment. The things you write after these “//” will not be taken as a command (means these things will not be compiled). It is always a good approach to write down the properties of the code at the beginning like author, for which aim this code is written etc.
Continue reading TEA BREAK WITH C++: Line CommentsTEA BREAK WITH C++: Opening a New File and printing famous “HELLO WORLD”
NOTE: You may download codes and extra source material for this book from https://bookofengineering.com/easyseries/
You can start a new file by selecting;
File > New > Source File OR pression Ctrl + N on your keyboard;
Continue reading TEA BREAK WITH C++: Opening a New File and printing famous “HELLO WORLD”