 Hello, everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So today we have day two of this C and C++ coding bootcamp. And I hope you have already gone through a day one session. So I just explained you a little bit basics about C programming. So today we will be understanding about programming languages and I will be talking about different language translators. Right? So this is the agenda for today that we are going to discuss. So before moving forward, I just want to welcome everybody, those who are joined, like those who have joined session live. So I just welcome them and those who will be watching the recording. So I just want to thank them as well. So as you can see this slide, so it tells about me. So if you have joined this bootcamp for the first time or you are watching this video for the first time on this channel and if you want to know about your instructor, so I'm just running Sanjay Gupta Tech School across the globe virtually and walked in various organizations having 16 plus years of experience and right now helping people to ramp the career in Salesforce ecosystem. So basically this C and C++ bootcamp is having two purposes. So it basically focuses on BTEC students and it also focuses on non-technical folks, those who want to make the career in Salesforce or IT industry. So they need to know basics of programming so these are basically two purposes I am doing this bootcamp. So if you know any BTEC student who is struggling with programming, so just refer this bootcamp to that student so that they can start learning programming step by step on daily basis. So be consistent because consistency is the key and do regular practice so soon like by the end of this week, you will be having a proper practice sheet that you can practice and join this telegram group where I will be sharing all the updates related to this bootcamp and if you have any doubt while practicing, you can discuss here, right? So just follow Sanjay Gupta Tech School on YouTube, LinkedIn, Instagram and Telegram and all the important links are available in the video description. So moving forward, let's talk about programming languages. So as a beginner, if you are starting your BTEC journey or you are from non-technical background, so you should know what programming languages are and how many types of programming languages are available, right? So basically, programming languages used to implement computer program which are known as software. So if you want to create any software, so it can be standalone standalone application, it can be mobile application, it can be web application, website or cloud application. So whatever you want to implement, so you need programming language for that. And nowadays, what is happening like we have some tools which are basically related to point and click. So on those tools, you don't need to do much programming and like lots of things are already programmed and you just need to drag and drop, but still you need to apply a logic. So if you know the programming logic, so it will be easy for you to understand the like you it will be easy for you to implement the solutions for any programming language, right? So if you don't know any programming language, so it will be better like you start with proper steps. So I would recommend first go with C programming then C++ and then you can pick Java, Python, Apex, whatever in whatever direction you want to go. But at least C and C++ everybody should learn in their professional journey if you want to make your career in IT industry. So here you can see we have two types of programming languages. So one is low level and another one is high level. So in low level, basically two types are available in which we have machine and assembly language and in high level, we have procedural and non procedural programming languages, right? So in procedural, we need to write all the codes and in non procedural, like you need to implement some code and few things are already implemented. So you can leverage the pre implemented things as well. Right? So this is about programming languages which are available. And like nowadays, you might have heard about cloud AI. So these are like latest technologies, but in the back end, they use different, different programming languages to build the software. Right? So core programming knowledge everybody should have. Now, if you are using any programming language to implement any application or any software, so basically we have some translators as well. So you need to know about these also. So a translator is a system software which converts instructions written in a particular language into machine readable form. So in any language, you write instructions in your readable form, but we need to convert that into machine readable form, right? So here you can see we have three types of translators available. So in these three types, first we have assembler, then we have compiler and third we have interpreter, right? So these three translators are available. So assembler basically converts assembly instructions into machine. So we generally don't use assembly language to implement any software. So it is basically used in the back end, but we prefer some languages. Those will be converted with the help of compiler or interpreter, right? So we need to understand the differences between compiler and interpreter, like what compiler is and what interpreter is. So I hope you can see two columns on left hand side, you can see few points related to compiler are mentioned. And on right hand side, few points related to interpreter are mentioned. So we need to know the difference between these two. So most of the languages prefer compiler. So compilers characteristic is it translates source code into object code at one go, right? So whatever source code you write, if you want to convert that into machine readable form, so whole code will be translated together. And whenever there are errors, so it will be showing all the errors all together, right? So it provides a permanent saved object file. Object file means it is in a form of binary. Then here debugging is slow because all the errors you will be having all together. So you just need to resolve them one by one. And execution is fast because every time when we execute the program, so translation is not required. It is already done all together. So that's why most of the programming languages use compiler to translate high level instructions into into low level instruction that is machine language, right? Now on right hand side, you can see we have interpreter. So interpreter basically translates source code into object line wise, right? So what happens in interpreter? If you try to execute your code and in your first line, if you see any error, so what will happen at that point, your execution will stop and you will be seeing the error, right? If you fix that error, then only remaining line of code will be translated. So this way we go with interpreter. So here you can see second point says it does not provide a permanent saved object file and debugging is fast because immediately you will be having the errors for the code that you will be implementing and execution is basically slow because every time whenever we execute the program, so translation is required. And why so because of second point, because whatever translation we are doing, that is not saved permanently. So every time whenever you want to run your code, you first need to translate and then it will be executed, right? So yeah, someone is saying my voice is low. So I'm just keeping my closer to me. So I think it would be better now. Okay, so I hope this way with this comparison, you are able to understand the difference between compiler and interpreter, right? And most of the programming languages use compiler. And if we talk about C and C++, so both uses compiler to translate the code into machine language. Right, so moving forward. Yep. So I just explained these two concepts like programming languages, types of programming languages, then we need to know the language translator. Now, before before moving forward, what I need to do like in yesterday's session, I just explained one example from this practice work, right? Now we have a few more examples. So let's let's implement these examples together. So if you are on laptop and if you want to practice these with me, so you can just implement these. And if you have the solution, so you can just share them in the chat so that everybody can see. So this, this is the first example, calculate area and parameter of rectangle, which we discussed yesterday. And if I show you the solution, so this was the solution that we implemented yesterday. And if you have any doubt like from last session, yesterday's session, if you have any doubt, so you can ask those questions in the chat, I will be answering those. So we created this code where we implemented simple logic to calculate area and parameter, right? Now, what we need to do, we will be implementing the second example, that is to calculate simple interest, right? So can you tell me if we want to calculate simple interest or what values we need to receive from the user? Like what what values you will be fetching from the user so that you can calculate simple interest? So can you can you mention in the chat like for simple interest calculation, what type of values we need? So by the time you are typing your response in the chat, I'm going to remove these statements from here so that we can implement new code. And this code title is to calculate simple interest, right? So if if you can type in the chat, I don't see any response yet. Okay, yeah, this one is saying PRT, yeah, this is correct, principle rate and time. So what we need to do here, I'm going to declare three variables PR and T, right? And one more variable where I will be storing the simple interest. So in yesterday's session, I told you, like, this is data type float as a data type, and PRTSI, these are variables. In variables, we will be able to store some values, right? So Abraham also mentioned correct response. So that is good. Now, what we need to do from user, we need to receive principle rate and time. So here I will be writing a printf statement, which will say enter principle, rate and time. Yeah, principle amount we can say and rate of interest and time we need to receive. So here we need to have scanf. So right now, how many values we need to receive, we need to receive three values PRT principle rate and time. So what you you will be doing, you will be writing percent F three times, you will be writing percent F three times then ampersand P, then ampersand R and ampersand T, right? So I hope you understood why in scanf I wrote percent F three times, because we are expecting three inputs from user. First will go into P second will go into R and third will go into T, right? So this way principle rate and time values will be available with us. Now what we need to do, we just need to we just need to implement the logic here. So can anyone tell me what what should be the logic to calculate simple interest? If you can write that in the chat, so I can see savior Mansuri already mentioned PRT, but I think it is not correct. So if you have Google, so you can just Google it out. And let me know the calculation. So yeah, savior this time it is correct, principle into rate into time upon 100. So if you want to calculate simple interest, so what you can do open parenthesis then P into R into T. So this way you can apply the formula and then you can write divided by 100. So this is the complete formula which is for calculating simple interest, right? So the calculated simple interest will be stored in this si variable. Now, what we need to do if you want to display the result for the user, so you will be using printf, then have a backslash n. And then you can write simple interest equals to percent f and then I right. So this way, this code is correctly implemented. And it is divided into four sections. So first we created all the variables, then we received some input from the user, then we applied some calculation, and then we displayed the result of the calculation on the output screen, right? So this way your result will be available on the UI. Now if I click on run, so here you can see it is asking for amount principle amount rate and time, right? So I just need to provide these values so that we can do some calculation. So for principle amount, I'm entering 10,000. For rate of interest, I'm entering 10, like 10%. And time I'm entering as three, three years. Now you can see the result. So if you have 10,000 principle amount for 10% rate of interest for three years, so simple interest will be 3000. So if it is rupees, so it will be in a rupee format, if it is in other currency, so it will be according to that, right? So I hope with this example, you are able to understand how I calculated simple interest, right? So if you're a beginner, so I think now you can relate like how we just need to implement the solution. So first we need to decide the input values, then we need to write the calculation and then we need to show the results. Okay, so moving forward, next we have one more problem that is we need to read marks of three subjects. And then we need to calculate total of those three subjects, like total marks, and then we need to show the percentage, right? So this another example that I'm going to implement for you, right? And this example, I'm just copying and I'm going to paste it in the chat. Okay, I'm not able to paste it because limit is 200 characters and this code is having more than 200 characters. So I think it is available here in this session. So recording will be available anytime if you want to watch it. So you can. Now I'm just removing this inner part of the main. And now we need to calculate total marks and percentage, right? So this is our requirement. So in this requirement, you can see we need to read marks of three subjects. So here, we need to create some variables. So I'm creating integer variables, marks one, marks two and marks three, then I'm creating total and percentage. So this way I'm creating the variables of where I will be storing all the values. Okay, so total five variables I declared. And whatever we are learning here in C programming, so if you go for C++, Java, Python, Apex, so most of the concepts are same, like there also you need to create some variables, then you need to receive some input, then you need to apply some calculation, then you need to show some results. So approach is different, but overall we need to do these kind of things only, right? So now here, these variables are created. Now, I'm going to write printf statement. So inside printf, what I need to do, I need to write enter marks of three subjects, right? So this way, printf is written and this is the message like enter marks of three subjects. Then again, you will be using scanf. And you need to apply a portion D three times, because you are going to receive marks of three subjects here, right? Now you need to store them into three different variables m1, m2, and m3. So this way, I'm going to create these variables. So first subject marks will be stored in m1 variable, second subject, subject marks will be stored in m2, and third subject marks will be stored in m3. Okay. So this way, second segment is completed. So first we created the variables, then we received some input values. Now we need to apply the calculation. So we need to calculate two things, we need to calculate total, and we need to calculate percentage. So if you want to calculate total, that is pretty straightforward. You can just add all these values m1, m2, m3. So if we add all three all together, so total will be calculated. Now after that, total calculation, what we need to do, we need to calculate percentage. So I'm calculating percentage. So P e r equals to now, in my case, like, maximum marks for each subject is 100. So I'm taking a consideration max maximum marks for each subject as 100. So this is my consideration, right? So if I want to calculate percentage of what I will do, I will divide it by 300 and multiply it by 100. So total upon 300 into 100. So this way, percentage will be calculated. In your case, if you want to take different maximum marks for each subject, so you can take total accordingly. So here I am using 300. Because we have three subjects and maximum for maximum marks for each subject is 100. So that's why total is 300 as per the requirement. So this way, we applied this calculation and percentages calculated here. Now, what we need to do, we just need to display total as well as percentage, right? So what I'm going to do, I'm going to use print f, then total marks equals to percent D and total. And in this case, instead of integer, you could have used float as well, right? Because marks can be in point form decimal point form. So if they are in decimal point, so total, you need to calculate and percentage also you need to calculate. So that will also be in decimal point values. So I took int but going forward, if you want to use float, you can do that as well. Then I'm going to use one more printf so that I can show percentage. So this way, I will be able to display total marks and percentage to the user, right? And in yesterday's session, I showed you how we can combine these two printfs together. So today, also, I will be showing you but I want to execute this for the first time so that we can check whether logic is correct or not. And then I will be converting these two printfs into one, right? So I'm just clicking on run so that it starts its execution. So I'm entering 50 as first subjects mark, then 75 as second and 100 as third. Okay, so here, we need to understand one catch. So total marks is two to five, but percentage is zero. Now why why it happened, right? This is important to know. So total is two to five. And here we have 300. So both are in diesel. Now if you divide two to five with 300, so result will be zero, like result will be some zero point something, right? But both are in diesel. So that's why that zero will be multiplied with 100 and everything becomes becomes 100 zero, right? So what we need to do here, we need to specify 300.0 so that it will become a decimal value. When you have a decimal value in a calculation, so other value will be converted into decimal automatically. And the result will mean decimal that will be multiplied with 100. And then the like the value which is before decimal point, that will go with this PR variable. Right? So this is the resolution that you need to take here. And going forward, what you can do if you know, like there can be possibility like decimal point values will be there. So instead of int, you can prefer float. Okay, now if I execute it again, so I'm entering 50, I'm entering 75, I'm entering 100. So this time you can see total marks is displayed, and percentage is also displayed 75. So I entered 50, 75 and 100. So if you average it out, so it will be 75%. Right? So this way, like I hope you understood something new today. And now I'm going to show you how we can combine these two printf into one printf. So I will be writing it here. So printf, then double quotes, then backslash and for new line. So this way, you can combine both the statements into a single print of statement. Right? So here you can see, first, we have backslash and which will be shifting the output into new line, then total marks equals to will display as is, then this percent d will be replaced with a total value and total value is available in this variable. So this variable will be displaying its value at this position, percent d. Next, we have backslash and so again line will change automatically. And this percent will be percentage will be available in the new line. And this percent d will be replaced with this PR. Right? So this way, I hope you understood how we can combine two printf statements together. Okay. Now if I run this code, you will see the same results. So if I enter 50, if I enter 75, if I enter 100, so you can see total marks is two to five and percent is 75. And in the same way, the result is appearing through single printf as well. Right? So these kind of statement we use in Java apex as well. But there we don't use backslash and or percent d. You can directly write the code and logical part is same. Right? You need to focus on particular data type and accordingly you will be implementing the logic. So those who are like BTEC student watching this live or watching the recording. So I think for you, don't focus on Java apex kind of word, just focus on this solution and implement it in your system. And you can see I am using the online browser. So online gdb.com is providing this. But on Google, if you search for any online C compiler, so you will be able to use and in the beginning of the session, I explained to you about compiler. So you can see C is basically using the compiler. Right? So this is the compiler that we are using here as of now. Okay. So I hope with this explanation, you are able to understand this third requirement as well like how we can implement the solution. Now, fourth one is a little bit tricky. So here basically what we need to do, we need to read the basic salary of an employee. And we need to print a gross salary where DA is 20% of basic salary and HRA is 10% of basic salary. So what what we'll be doing, we'll be reading basic salary and basis on that basic salary, we need to calculate gross salary, right? And if we combine basic salary, DA and HRA, then you will be having gross salary. Now you might be thinking what is DA? So DA is dearness allowance. So whenever inflation rises, so basis on that this dearness allowance is also increased in our salary as a component. And HRA means house rent allowance. So if you do a job, so in your pay slip, you will see, sorry, so companies will be paying you HRA house rent allowance. So in this requirement, DA is 20% of basic salary and HRA is 10% of basic salary. So these two we need to calculate. So can anyone tell me like how many inputs we need to receive for this calculation for this program from the user? I am repeating again, how many inputs we need to receive from the user for this fourth problem? So we have four entities basic salary, gross salary, DA, HRA. So what we need to read as an input from the user. So you just need to mention in the chat, like, will it be basic salary, gross salary, DA, HRA, or like two combination of two combination of three combination of four. So whatever is coming in your mind, just post it in the chat so that I can see how logical you are able to or think. So I'm just waiting for your response. Like if you if you can share your thoughts, so it will be great. Otherwise, I will be explaining to you. Okay, so in my opinion, we just need to read one thing that is basic salary. Right. If we yeah, so count is right. If we have basic salary, then we can calculate DA through that basic salary, we can calculate HRA through that basic salary. And if we combine basic salary, DA and HRA, so it will be all together your gross salary. Right. So we need to receive one input here. So now I'm going to do it for you. So I'm going to implement the solution. So title will be calculate gross salary, we need to calculate gross salary. So here I'm using float as a data type because in salary, we will be having decimal point values. So float basic salary, DA, HRA and gross salary. But if we if we focus on the input, so we'll be receiving only one value that is enter basic salary. So scan f one time percent of you will be using and then that basic salary will go into BS variable. Right. So this way, single input we need to receive. Now we need to do some calculations. So first we'll be calculating DA. So how much DA is it is 20% of basic salary. So what I can do 20% of basic salary. So basic salary into 20. So I can enclose it in single, sorry, parenthesis, and then divide it by 100. So if you multiply basic salary with 20 and divide it by 100. So your 20% amount will be stored in DA basis on that calculation. Okay, now we need to calculate HRA. So HRA will be like basic salary into 10 and then upon 100. Right. So this way your HRA will be calculated. So Molek basically, we don't need to read all four values. We just need to read only basic salary. Then here you can see on the screen, I just calculated DA and HRA basis on the basic salary. And now after this calculation, what we need to do, we need to calculate the gross salary. Right. And I already told you the formula for gross salary. So for gross salary, what we need to do, we just need to add basic salary with DA with HRA. So if you combine all four all three entities together, so you will be having gross as gross salary calculated. So what I need to do gross salary equals to basic salary plus DA plus HRA. Now after this, what you can do, you just need to show gross salary to the user. So you can type gross salary equals to then percent F then comma and here you can say we need to display gross salary. Right. So this way you can see the results are available here. So whatever code I have implemented is available in front of you. So first we created four variables, basic salary, DA, HRA and gross salary, then we received basic salary as an input from the user. Then we do, we did some calculation for DA and HRA. And here now you can see we have done calculation for gross salary. So gross salary calculation is also available in front of you. And you can see after that we are displaying the gross salary as a result. So this way you can just implement the solution for the logic that is available for you. And this logical part is same for all the programming language wherever you go. And that is important. Reading and printing may change as per the syntax, but this logical part is same for everywhere. If you write this code in Apex, so it will be same. If you write it in Java, it will be same. Right. So that's why as a beginner, if you are starting your BTEC journey for any branch, whether it is CS, IT, electronics, electrical, any branch, no matter, if you want to like learn programming, so your first step should be C. And if you're non tech folks, so if you want to make your career in IT industry and you have an aspiration to become a developer, so C programming is the best way to understand logic building. So you can see how quickly we implemented this solution. Now if I run it, so what I need to enter basic salary. So let's say basic salary is 10,000. So 20% of 10,000 is like it is 2000. And 10% of 10,000 is 1000. So as per my calculation, total or gross salary should be 13,000. Yeah, so here you can see gross salary is equals to 13,000. Because we entered basic salary as 10,000, then due to this calculation, we are getting this result automatically. Right. So what you need to do, you just need to understand how we can implement the logic and programming. So I think step by step, if you do practice, so you will be able to understand all the basic core concepts of these, like programming. So if you have any doubt now, you can ask. So I told you like I will be explaining each and every program in front of you. So that I did. And if you have any kind of question related to this C and C++ bootcamp or anything that you want to discuss. So like this platform is open for that. And if you understood whatever I demonstrated and want to practice, so you can just leave the session and you can do some practice. And tomorrow I will be explaining you some more theoretical concepts, along with some C programs. Right so session tracker is already available with you. So if you go with this session tracker, so here everything is mentioned. So in tomorrow's session, we'll be discussing about compilation process. And I will be explaining few more examples to you. Right and then you can see next week, three more sessions will be there and we'll be discussing few more programs. So I keep on updating this session tracker frequently. So just take take a look on that and all the recording links and live sessions links will be available here. And this exercise sheet is pending with me. So by the end of this week, I will be preparing it and we'll share a link here only so that you will be able to access. Right so this this way, day by day, we will be picking few topics, few programs and we'll be understanding the core concepts of C programming first and then we'll be focusing on the C++ right so just a request like if you if you see anyone struggling understanding programming, so you all know my teaching style is very easy. And like I am explaining topics slowly explaining each and everything in detail. So just just share this information with all those BTEC students. Those those have started their journey already are in first year or if they are going to start their BTEC journey. So they will be able to understand these things properly live and free of cost. So these sessions will be available in recorded form later as well. So still if you reach out to someone, that will be great. So like I know like you you are passed out from different different colleges and maybe from different engineering colleges as well if you are from non CSIT BTEC branch. So just share this information with your college like Sanjay Gupta Tech School is arranging CNC++ bootcamp or Salesforce bootcamp for free of cost life for students as well so that more students can join these bootcamps and they can they can learn programming live and discuss their doubts and challenges and Salesforce live bootcamp is no one running in the entire ecosystem. So that I am doing only so Salesforce is also connecting with students right so if you see anyone who wants to learn Salesforce live and wants to do practice and they are in their college journey right now as a student. So they can also learn like they are they already know CNC++ so they can brush up their skills from the CNC++ sessions and they can follow the Salesforce session tracker so that they can start learning admin and development from there. Okay so going forward savior I will be explaining things in English and in the Hindi as well. So just remind me whenever you want an explanation explanation in Hindi right because I will be focusing on English much but if you see anything that you want to understand in Hindi so just let me know in the chat I will be explaining that in Hindi as well because I just want to make these sessions in English because my channel people watch from across the globe so few people those are on different geographical location and right now they are not able to join so they watch the recording as well so that's why I keep on talking in English only so that I can cover a wide audience but still for this bootcamp only if you need explanation in Hindi so basis on your request like you can say like please explain this particular part in Hindi as well so I can do that for sure. Right but primary communication language will be English secondary as per your request can become in the as well and one more request like please do some reviews and feedback on the channel so that I can see like how well I'm doing for you and help me to reach a hundred K subscribers so this is my dream like half of year already gone and six months are remaining and I made a resolution like by the end of this year I will reach to hundred K subscribers but you can see right now it is hitting 60 K this month I need 40 K more so if you if you if you support me and share this channel link with folks those are connected in your WhatsApp group Telegram group and spread the world with those folks so I would be hitting that hundred K subscribers milestone by the end of this year right so this is my dream let's see whether I will be able to achieve this this year but if not this year then for sure in the first half of the next year surely I will reach to hundred K subscriber benchmark or milestone okay so this is a humble request if you want to show some gratitude so you can just share the link with as many folks as you can so share with your colleges as well from where you graduated so if you're watching this recording so this is request from you and I'm doing my effort like whatever 60 K I got that is due to all efforts right and now with 60 K I can have 40 K more so that will be from your support only so I'm doing my all hard work consistently but I need your gratitude and supports as well so yeah any any WhatsApp no I don't want to share my WhatsApp group I am saying like if you have any WhatsApp group where student community is connected or Telegram group where student community is connected and they want to learn Salesforce or C or C++ and other things like cyber security DevOps data science those I will be like starting from next next month or so so please share this link with them okay with this note I take your leave and will be correcting tomorrow same time we'll a few more topics and we'll be explaining them to you thank you so much for joining today's sessions and spending some time thank you everyone bye take care