C++ tutorial for beginners

Upgrade to remove ads
Upgrade to remove ads
Unformatted text preview:

C Full Course 2023 C Tutorial For Beginners C Programming C Projects SimpliCode C plus plus is a journal purpose programming language and is used in various areas like operating systems games browsers etc In this video tutorial we will cover everything you need to know and understand the C plus programming language before we begin make sure to subscribe to the simply code channel and press the Bell icon to never miss an update we will learn how to download and install C plus on vs code and Dev C plus in windows download We can click on this open folder here it is now we need to install this file make sure there must be 293 2 MB of free space on that particular disk space now we have to configure it so that the C plus programs can run in this code editor if else Statements are two conditional statements that are generally used when we want to run the code based on some conditions we run a block of code which is inside if statement only if the condition is true For example if the number variable here is equal to 10 then only the block will execute and will print the message you got it otherwise it will run the else block Let s do a simple program to check whether the program is running on this code editor or not So we ll include the header files I should include iostream inside int main will display a message welcome to this video make sure to save this after making changes or you can click on control s s let s learn how we can download Dev C plus plus a nd run C plus programs in that so let s move on to learn how how to download and configure visual studio code for C plus programs we ll click on open folder here it is Dev c plus setup now we ll click on setup in order to perform a particular task or operation Many number of times we need loops these are used when we want to execute a block of statement repeatedly rather than just writing statements again and again There are different types of loops like for loop while loop do while loop then t here is nested loop After that there are nested loops Different types of loops are used in different times depending on the type of loops used in the program for loop is a repetition control structure that is used to iterate a piece of code based on the condition is true or false While loop will execute the set of instructions once before checking If the conditions are true nested loop When one loop is defined inside the body of another loop then it is known as nested loop in C plus plus The continue statement is a bit similar to the break statement as it is also used for termination but the difference is that it is used to terminate the current iteration and not the complete loop in break statement The complete loops flow terminates so within the loop the control skips or terminates that particular iteration and continues with the next one we will do some examples On breaking continuous statements in our code editor that is vs code now we ll name that file as loops dot CPp a basic program will be a basic program just to understand it write the header file hash include iostream Now I will write using namespace standard we ll write a for loop with a 4 keyword inside the for loop We ll put a condition i less than equal to 10 which means the loop will keep on executing until i is less than 10 all we have to do is to print I so that all the digits get printed along with the loop The syntax of do while loop is do keyword and now we will add some code inside the body We will write sum equals sum plus i here What we are doing is We are simply adding some variable and i variable and storing it to some variable itself make sure to put a semicolon in the end In case of do loop the output is sum 45 which is the right answer the pattern which we are going to build is having increment of star as the number of rows increments the pattern is half pyramid form using stars with the help of nested loops we can make some more different types of patterns using nested loops but we have done only one example in order to understand the concept in this program all we have to do is to print the numbers from 100 to 90 only excluding 96 from them after that we ll increment this by 10 because we want the numbers to be printed like 100 110 120 up to 150 after that we are out of the loop This means the code works fine There are two types of functions in C plus that is built in functions and user defined functions These are also known as predefined functions or library functions we do n t need to define these functions because these are already present in libraries and the implementation of these functions are also available in library files we can also pass data into the functions in the form of parameters call by value is a method in which copies of variables are passed to the functions the function and its return type acts as an identifier for a function the names of parameters are not important in the function declaration only their type is required the functions are called by writing the name of function and after that writing the required parameters inside the brackets call by reference in this method instead of passing the arguments The address of the argument is passed to the formal arguments of the function and the address is used to access the actual argument referring to the same location so any changes that are made gets reflected to the actual parameter in the output The values of variables are actually swapped Let s make a new file call to dot CPp Let s include the header files hash include iostream now we ll write using the name space standard Now we will write int main we will declare a variable cell and assign 27 000 to it as we have done previously now we will call a function named increment and inside the bracket We will pass the address of cell as we know that in case of call by reference We pass the address in this function We ll write code to do the sum of these two integers and for that we have to store the sum in a variable we ll print the variable s because after the function completes its task of addition the output will come back to the calling function which is getting stored in the variable Let s create a new file function1 Cpp Recursion can be defined as a process in which a function calls …

View Full Document
Download C++ tutorial for beginners
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...

Join to view C++ tutorial for beginners and access 3M+ class-specific study document.

We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view C++ tutorial for beginners 2 2 and access 3M+ class-specific study document.


By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?