Sunday

What is Clear screen

Clear screen (cls) :-
                                Clear screen is an operator which is used to make the screen be cleared. And it is commonly used when we want to remove all the data written before it

                                      

and it is part of the header file <stdlib.h> and it is compulsory to include the header file because it shows we have included it properly. For using this  operator cls command is used instead of whole clrscr ( ) function.
                                                                                                                                           The proper syntax of using it is given below :
  
                                                        










What is setw ( )

setw ( ) manipulator :-
                                   It's full form is set width and it is used to set the width of the output statement or screen. Mean's by using this manipulator we can restrict our output to the digits to which we want. The reference can be given by setw (n). 
                                                     Where n specifies the width of the out put screen and is an integer value. And if we want to use this manipulator then a header file <iomanip> is used because setw ( ) is part of this header file.

The proper syntax is given below
                                   
                                                    #include <iostream>
                                                    #include <iomanip> 
                                                    using namespace std;
                                                    int main ( )
                                                   {
                                                     cout << setw (10) << "Asia" << setw (8) << "Europe";
                                                     return 0;
                                                    }   

Saturday

What is sizeof ()

sizeof ( ) :-
                        About sizeof ( ) the simplest concept is just it is a keyword (the words which are already declared to the programming languages and there is no need to explain them again & again) as well as an operator.



 In C++ it is used to find the size of the data type which is declared to any variable or constant and it requires a proper syntax to be written down.
                                                                    A program which contains sizeof ( ) with proper syntax is given below :

                                                           #include < iostream>
                                                           using namespace std;
                                                           int main ( )
                                                          {
                                                            int a;
                                                            cout<< sizeof (a);
                                                            return 0;
                                                           }

What is Data Type

Data Type :-
                       Data type or in the simple form type is a type of classification or a group that contains and identifies one or more kinds of data.

                                 

                                  


 And it's examples are boolean, integer, real etc.. And it determines all the possible values of that type (which it contains). And data type is further split into two parts :


  1.  Primitive Built in type.
  2.  Reference type.


But here we will just discuss first type (Primitive built in type) because these are used in very vast range in C++ programming language.

Primitive built in type :-
                                        This is a type of data type for which the programming language provides built_in support. Means these are present in the built_in memory of the programming language. And they are further split into seven categories. And all these are shown in the following table :









Compiler in C++

History :-
                    It's important to know about the history of the thing about which we want to know. The first compiler was written by    Grace Hooper 



in 1952 for A-0 system language. For this the term compiler was also used by Hooper. Another important thing which must be addicted that is the A-0 system language was used by Harvard Mark 1 and the device was also invented by Grace Hooper with the assistance of Howard Aikens and by the Howard University it was called Mark 1 for increasing it's capacity compiler was developed. And the first C++ compiler was developed by    Dennis Ritchie



 in 2011 and since that time up to now the IT professionals are trying to make the capacity of compilers be more enhanced.

What is compiler ?
                  In computing a compiler is a program that processes statements written in a particular programming language

                                         

                                                                                                               and turns them into the source statements written in machine (away from human understanding or low level language) language or code, which the computer's processor uses. Now the question is what are source statements? 
                                                                                                                                        The question may be answered as typically users may use Pascal, C, C++ or some other kind of languages so at the time of conversion each line at one time uses an editor to convert itself into the machine language and after the conversion a file is created by which all the lines are contained is known as source statement. Many conferences have been done regarding the improvement of the compiler's capacity and efficiency. Names of some organizations are mentioned below who are working on it's progress :
  • Programming language design and implementation. (PLDI)
  • Principles of programming languages. (POPL)



  • Object oriented programming, system, languages and applications. (OOPSLA)
  • International conference on functional programming. (ICFP)

Friday

White spaces and white lines

White spaces :-
                             Those spaces on the C++ environment page which are unoccupied by any character, word or line or we can say the spaces which are left empty are known as white spaces. And these are ignored by the compiler and we use it for our own assistance.




White lines :-
                           The lines which are totally occupied by white spaces are known as white lines. And these are also ignored by the compiler.


Thursday

Comments in C++

Comments :-
                                      In C++ programming language comments are the single line or multiple (more then one) line statements which are used by the programmer for his own assistance (help) are known as comments.



And they are totally ignored by the compiler. In it programmer can write anything by which he can be helped. In C++ programming language comments are commonly used to highlight something and also have a proper syntax in which they are written down.

There are two types of comments :

1) Single line comments :-
                                 As it is clear by it's name that the comments which depend upon one line are called single line comments and it's length never exceeds from one line. And it's syntax is the comment is written after double forward slashes //. 
For example :
// This line includes header file which is <iostream>.
#include <iostream>    

2) Multiple line comments :-
                                        The comments which depend upon more then one line are called multiple line comments. And regarding it's length there is no restriction it's length can exceed any limit. It's syntax is it starts with /* and ends with */.
For example :
/* int main ( ) is starting point of a program and in cout that line is written which has to be printed and semicolons are the statement terminators. */
int main ( )
{
  cout<< " Welcome ";
  return o;
}





What are keywords

Keywords :-
                         When we have a deep view on the word keyword then we come to know that it is combination of two words Key and Words as we know key is something by which locks are opened and it can also be said the words which themselves are keys to open certain locks or  to perform certain special tasks are called keywords.

                                               Now lets have a look towards the real concept of keyword, it can be defined as the words which are already given to  the computer program and have certain meanings to them and there is no need to explain these words again and again are called keywords. For different purpose a different keyword is used such as endl, do, or, if and else etc are the different keywords for different purposes.


Wednesday

What is endl

endl :-
                endl is a keyword which is used to end the current line or terminate the present statement. And we use it if we want the next statement to be printed in the next line. And another interesting thing is that it is short form of end of line which makes it more clear that it is used to end the current line. And in program it is also used with proper syntax.

                 The syntax is:
                 
                                            #include <iostream>
                                            using namespace std;
                                            int main ( )
                                           {
                                             cout << "Hey..!" << endl << "How are you..?"; 
                                             return 0;
                                           }
       
    We will use this syntax if we want ( Hey..! ) to be printed in the first line and ( How are you..? ) to be printed in the next line. Hence, by using this basic syntax critical programs can also be prepared. 

Basic information about C++ program

Simple C++ program :-
                              As the syntax of simple C++ program has already described in the previous topic of syntax. But, as it was also told the word syntax will be repeated again and again. So, lets have an overview that what is syntax? So it can be explained as the way of writing down a program by keeping all rules and regulations in front of you which are compulsory for the proper execution of a program, like adding header files, specifying regions, and proper standard library.
   
So here a simple program is shown below:
               

#include <iostream>
using namespace std;
                                                                int main ( )
                                                               {
                                                                cout<<"Welcome";
                                                                return 0;       
                                                               }

#include <iostream> :-
                                           In the above program the first line is [ #include <iostream> ]



 in it the word #include is syntax of writing down a C++ program and as it is already explained before that syntax is compulsory with proper  rules and regulations so it is also compulsory.'
                                                                                               Now lets move to the next part that is <iostream> so it is important to be addicted that it is Header file.

 Now the question is what is header file ? The question can be answered as it is the file which includes all the functions which are to be performed and we can also make the idea clear for the instant by saying that it includes all the inputs (which has to be taken from the programmer) and outputs (which has to be displayed on the screen after the execution). And it is present in the standard library.
Using namespace std :-                                                                                             
                                 Now, lets move to the next line that is [ using namespace std; ].This line tells the compiler to use a group of functions that are part of the standard library (std).




        In it using is a keyword and also the syntax of this line which shows the usage of the namespace and std.
Lets discuss what is namespace ? So, it can be answered as 
                                                                                   1)A namespace is a declarative region that provides a scope to the identifiers (the names of types, functions, variables, etc.) inside it.
                                                                                            2)Namespaces are used to organize code into logical groups and to prevent name collisions that can occur especially when your code base includes multiple libraries.                                        
                                                                                   3)All identifiers at namespace scope are visible to one another without qualification.

Overall the basic concept is, it provides caliber or boundary or region to the compiler by which it prevents to get confused between two things of the same category. For example if we perform a task of volume gain then compiler will be confused because the function, gain in volume is performed in music library and in physics library also. If we want our program to make a sensible execution then it is compulsory to use namespace because in this way compiler will know which task to perform.  
                                                                                                            Now the term which was left is std, so about it now the concept must be restricted to just, it is short form of standard and we can also say it is standard library which includes all the header files and the header  file <iostream> which we discussed above is one of it's header files.

int main ( ) :-
                              For this part just the only concept which we should have to keep in our mind is it is the starting point of a program. Means program starts from this point and all the lines written before are the syntaxes.

cout<<"Welcome"; :-
                                           cout is used to print the lines or words which we have to print. And it's proper way is to write the line or word in inverted commas as shown in above written program with proper logics.


   



return 0; :-
                        After writing a proper program at the end return 0 is written because if we do not write it then whenever we give any input to the program then after the execution in spite of closing the display the program will not be stopped but keep on running which causes a burden on the RAM so that's why return 0 is used because it tells the compiler that the output has displayed and 0 output is left so automatically program will be stopped and any kind of loss will not be occurred or not even expected.
                       
Blocks :-                               
                       The logically connected statements are called blocks. And these lines are written in curly braces { } . The logics are << , "" etc...

Semicolons :-
                              Semicolons (;) are the terminators which are used to end the statements because when any statement ends then it is just visible to us not to the compiler so in order to make this scenario clear to the compiler we use terminators or also can say semicolons.




Tuesday

C++ program syntax, pseudo code and algorithm.

(NOTE: During the time when you study about C++ program your focus must be only on the concept.)




Syntax :-

             The word syntax describes the way in which something is written down or typed on the computer. Now for sometime forget about the C++ program. Initially it is compulsory to make the idea of syntax clear because this term will be used again and again.
                                                                           And it is also said that it is the set of rules, principles and processes which are to be implemented and if these are neglected then the task will not be declared correct. Similarly it works in our programs and important as well. It means without it program is not program but just a pseudo code. And the term syntax is not restricted to Programming language but is also used in many other fields. There are many types of syntax but as it's types are not part of the topic so you must save yourselves to get entangled to study deeply about it.
           

  -:The syntax of C++ program is given below:-                   


#include <iostream>
using namespace std;
                                                                int main ( )
                                                               {
                                                                cout<<"Welcome";
                                                                return 0;       
                                                               }
                    
                                                                                                     As discussed in above paragraph the question arises what is pseudo code? This question can be answered as it is a simple way of of writing down a program or any instruction step by step in simple english or any other language. As our topic is Programming language so we will just stick to writing down program in simple way and in a proper sequence.

                               
                                        If we discuss pseudo code then another thing relevant to it must also be discussed that is Algorithm. So, it's definition is almost similar to pseudo code. It is defined as the step by step process of writing down instructions, but only one point is contradictory between pseudo code and algorithm that is pseudo code is written in simple english or any other language but an algorithm has specified or we can say proper language in which it is written down.






Basic info about programming languages

Programming Language:-
                                                         To make the idea clear that what is programming language initially let's have a view that what is program? So, it is termed as a set of written instructions which are written down to perform a specific task which we want to. Now we must go through the definition of programming language because in this way it's basic concept will be delivered. Definition: Simply,the languages in which a program is written or we can say codding is done is known as programming language.like C, C++, Java, Java script etc...




Basically three types of Programming languages exist which are given below:  

1) First one is Machine level or Procedural Programming language: Language which requires sequence of statements to execute the program like C, COBOL, Fortran, etc...

2) Second one is High level or Functional Programming language: Language which uses some functions to perform the required task on the stored data an important example is data sorting out function. ML, Haskell, and Erlang etc are some of the examples.                                                                                 
3) Third one is Middle level or Assembly or Object Oriented Programming language: For those who are at the starting point of learning programming the concept is limited to, "it is a language which uses an object or a class of objects to perform a specific task like C++,C sharp, Java and Java script etc...
                                  


  Click on the following link to make the idea properly clear
                                             
                                                     https://youtu.be/J1qLdYRv81Y


   
(NOTE: Initially we will just discuss C++  because if we occupy something's roots then it becomes easy for us to get the working principle of that thing. So now a days C++ is considered as basic to learn about high level Programming languages.)


C++ Programming language:- 
                                                 This programming language was developed by Bjarne Stroustrup 






in 1979 at Bell Labs 




during when he was doing work for his Ph.d thesis. He was the IT professional who got success in developing it. It was needed by the professionals for the very long time and many of the IT professionals were trying to develop the language which could perform better then the previous one because the computers were getting very popular in that era and the tasks which computers had to tackle and manage were getting sensitive and critical so there was need of it because before the availability of this language the language which was used was not of very good quality and could not perform some of the tasks which this one can. 
                                                                        So, now it will be easy to get the idea about C++, the simple description of C++ is it is a middle level programming language




 means it performs both, the tasks which are performed by low level programing languages and the tasks which are performed by high level programming languages as well. It is said to be middle level programming language because it is more near to machine and far away from the human. The meaning of this statement is its easy for our PC's to understand it but when our brains come to know that what tasks are being performed at the back end then it is too much difficult for us.