 Hello friends, I am Naval Yamal working as the Assistant Professor in Mechanical Engineering Department, Walshchon Institute of Technology, Singapore. In this video, we are going to see the programs on C++ Part 4. Learning outcome, at the end of this session students will be able to understand basic programs of C++. The result of this video is programs on C++. First program, a simple program to check whether a number is even or odd using if-else statement. So looking at the four videos of basic four videos, we will come to know that the header files and the simple programs, so we will directly continue with the program. C++ include iostream int main, here I have taken one variable that is number and after that cout enter an integer whatever the user enters as an integer that is stored in number. If number percent is also called as module is divided by 2 that is equal to equal to 0 means whatever the user enters if it is divisible by 2 and if the remainder is 0 we get the number is even else the number which is entered by the user is odd. So there is a simple program to check whether the given number is even or odd. So the output enter an integer if the user enters 5, 5 is an odd. Second program C++ program to check if a year is a leap year or not. So we will start the program here taking one variable called as int enter a year whatever the year is entered by the user is stored in a variable called year. There is same logic again if year module 4 is equal to 0 that is the year entered by the user is divisible by 4 and we have one more condition we are using nested if else condition here nested if else statement here if the same year is divisible by 100 also as well as 400 also then the year is a leap year. For example if you take 2000 as a year it is divisible by 4 it is divisible by 100 as well as divisible by 400 then 2000 is called a leap year. So there are three conditions it is 400 and 400 so the program is contained in the next slide else see out year is not a leap year else year is not is a leap year or else year is not a leap year. So return 0 for this the output will be if you enter a year 2019 2019 is a is not a leap year. So we will see next program that is C++ program to find the largest of two numbers so ash include iostream.h header file int main we are taking three variables here that is ab and the big so we need to take two numbers from the user and whatever the two numbers are entered by the user are stored in a and b I am using if statement again if a is greater than b then big is equal to a so the a will be bigger year in this case else b will be bigger. So the final output will be the biggest of the two numbers is we are calling b which is bigger return 0 the final output will be enter two numbers three and four the biggest of the two numbers is four. So try to think on a program to find the largest of the three numbers pause the video for few seconds and try to think okay here the program is similar to finding the largest of two numbers here we need to take one more variable extra than what we have taken in the finding for the two numbers. So here we are taking abc as a variable and big as one more variable so we need to take the three numbers from the user that is a b and c whatever the user enters that is stored in a b and c we assume that a is biggest in the first case let a that is biggest number then b and c if that big is less than b that big is nothing but a that a is less than b and we are using nester if conditions here if b is greater than c and b is big is equal to b else this can be one condition else big is equal to c so it can be a can be bigger b can be bigger and c can be bigger the program is considered in the next next slide so else if big is less than c if c is greater than b big is equal to c else big is equal to b or else big is equal to a so the biggest number will be amongst abc or c once the user enters three numbers that is 2, 3, 4 the biggest number will be 4 so we will see the next program to calculate average and percentage marks of a student so here we are taking we are taking int marks 5 that 5 refers to we are taking 5 subjects marks as a input and we are taking one more data type that is float sum c out enter marks obtained in 5 subjects and those 5 subjects are physics, chemistry, maths, c s and English so here we are using a for loop in for for studying or for knowing more about the for loop you refer the videos of my colleague wood guesser which is described in detail for the for loops so for for loop we are using initialization then assigning the value then incrementation if i is equal to 0 and if i is less than equal to 5 less than 5 and i plus plus here whatever the user enters 5 numbers that is 5 marks that is stored in marks then we are using a condition here sum is equal to sum plus mark then the program is considered the next slide so float here average is equal to sum divided by 5 whatever the sum of all 5 numbers was sum that is divided by 5 so from there we get a average so we are taking one more variable that is percent p r c percent is equal to sum divided by 500 that is summation of all the 5 digits divided by 500 into 100 so we get in percentage so the final output will be average marks and we are calling average and percentage is equal to we are calling the variable percent and showing it with a symbol also written 0 so you get the first statement as enter the marks obtained in those 5 subjects and if the user enters these values the average marks will be 76 and the simple formula is taking the sum of all 5 and divided by 5 you get average and for percentage sum divided by 500 if each subject is of 100 marks divided by 500 into 100 you get in percentage so the references these are the references which I have used thank you