Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Bookmark
Share
Add to Playlist
Report
Learn Programming Technique C to Master Skills - Explanation of First Program of C Language in Code - Blocks
Tutorials Arena
Follow
10/8/2024
Category
š
Learning
Transcript
Display full video transcript
00:00
Hello everyone, this is Sandeep.
00:06
In my last video, I have explained the flowchart of SimpleIntest.
00:11
And in that flowchart, I have explained how to take variables and then to initialize it.
00:22
So this is the flowchart and here I have initialized the values of variables, the four variables
00:31
I have declared as p, r and t and I have initialized the value of principal, time and rate of interest.
00:38
Then I have applied the formula okay and after that resulted values stored inside at s and
00:46
then it is displayed.
00:48
So this is the program and today I'm going to implement this program in C and I'm going
00:57
to make the program in code blocks.
01:00
So let me open the code blocks to make the program.
01:07
When we take the variables, when we declare the variables, the memory locations will allocate
01:18
inside the random access memory as we have taken four variables.
01:23
So four memory locations are going to allocate inside random access memory, one for p, another
01:29
for t and for r and then for s.
01:33
So inside this bigger location, RAM is a bigger location, the four small location or you can
01:38
say the sub locations are going to create that is p, t, r and s.
01:44
Then I have initialized the value, I have given the fixed value, I have given the fixed
01:48
value of principal, I have given the fixed value of time and rate of interest.
01:53
Calculation will take place, I have written the formula, the calculation will take place,
01:57
the resulted value is going to store inside s and then by print s, the resulted value
02:04
is going to display on the screen.
02:06
So whenever I will run this program, I am going to get the same result as the values
02:14
of principal, rate of interest and time are same.
02:18
I have initialized it, that's why whenever I will run this program, I am going to get
02:25
the same result which is stored inside s.
02:29
Now I am going to implement the same program inside the code blocks, this is the code blocks
02:36
and how to make the program, let us see.
02:39
For it, I will go to file, then I will click on new, here I am having what empty file,
02:45
I will click on it and again I will go to file, then I will come to what save file,
02:51
I give a name to it, prgnew1 something like this and then what save, then I will use the
03:04
header file and that header file is what stdio.h, inside it I will use what int main and then
03:15
I will declare the variables that is int s for simple interest, p for principal, r for
03:21
rate of interest, t for time.
03:25
Here what I will do, I will give the fixed values as there in the program, in the flow
03:34
chart, so the principal is 1000, time is 2 and r is rate of interest is 3, so same values
03:44
I am going to give, r is 2, r is 3 and t is what 2, so rate of interest 3 and time
03:56
is what 2.
03:58
So I have initialized the value of principal, rate of interest and time.
04:02
Now what I have to do, I have to apply the formula s equals to p into r into t upon 100.
04:11
So I have started with very simple program, so everyone can understand it, then slash
04:17
n int type slash n simple enter interest is type a specifier percent d, where is the value
04:28
inside s, semicolon and that at the end what return 0 as it will indicate that there is
04:39
no error in the program, everything is fine, let's give the indication to the operating
04:43
system that after run the programs will terminate without error.
04:51
So this is the program friends and I am going to explain each and everything, what is the
04:57
meaning of hash include, why to use hash include in our program, what is the meaning of stdio.h,
05:05
why to include the standard input output header file in the program, why always we
05:09
start the program with the main, what happens when we declare the variables, why to use
05:14
semicolons at the end of the statements, why to use return 0, as I have just told you that
05:25
it shows that there is no error in the program and it's going to terminate successfully,
05:34
that's why we use what return 0.
05:37
So I am going to click now on the build button, here you will see what build button, when
05:44
I click on this, it's going to compile and it shows that there is no, there is zero and
05:50
the zero warning.
05:51
Now intentionally what I will do, I will remove the semicolon from one of the statement and
05:59
again save it by using ctrl s and go to build okay, when I click on it, now it's showing
06:06
me the error, see what the error it's now showing that expected semicolon before printf,
06:15
it's showing me, it's showing the red box and showing me that above printf you haven't
06:20
used the semicolon at the end of the statement.
06:24
So I will go here with the semicolon, again save the program by use of ctrl s and again
06:30
I will, I'm going to click on what build button, this is the build button okay, now it's showing
06:36
what zero error and zero warning, so now the program is error free, I'm going to run it,
06:42
so when I click on the run button, it's showing with a simple inter 60.
06:46
So whenever I'm going to run this program, it's going to give me the same result as the
06:52
values are what fix 60 okay, so I hope you understand how the program run and we get
06:59
the result.
07:00
In the next video, I'm going to input the values of principal rate of interest and time
07:06
okay and then I'm going to calculate the simple interest, so I'm going to input the values
07:11
of principal rate of interest in time and then I'm going to calculate the simple interest
07:16
and then it's going to display, thanks for today.
Recommended
2:41
|
Up next
Learn Programming Technique C to Master Skills - Explanation of First Program of C Language in Flowchart
Tutorials Arena
10/8/2024
5:14
Learn Programming Technique C to Master Skills - Single If Statement Program Explanation
Tutorials Arena
10/12/2024
4:14
Learn Programming Technique C to Master Skills - Explanation of Second Program
Tutorials Arena
10/8/2024
7:56
Learn Programming Technique C to Master Skills - Nested If Statement Program
Tutorials Arena
10/12/2024
5:21
Learn.Programming Technique C to Master Skills - Introduction of C Language
Tutorials Arena
9/29/2024
8:08
Learn Programming Technique C to MasterĀ Skills - First Program of Function
Tutorials Arena
11/3/2024
12:06
Learn Programming Technique C to Master Skills - Continuous If Statement Program
Tutorials Arena
10/8/2024
8:07
Learn Programming Technique C to Master Skills - Loop with if Statement Second Program
Tutorials Arena
10/17/2024
12:25
Learn Programming Technique C to Master Skills - Call By Reference Program
Tutorials Arena
11/8/2024
3:22
Learn Programming Technique C to Master Skills - Use of Type Specifiers in C Language
Tutorials Arena
9/29/2024
11:41
Learn Programming Technique C to Master Skills - Second Program of Array
Tutorials Arena
11/1/2024
6:40
Learn Programming Technique C to Master Skills - Explanation of Array
Tutorials Arena
10/20/2024
12:26
Learn Programming Technique C to Master Skills - First Program of Array
Tutorials Arena
10/20/2024
9:20
Learn Programming Technique C to Master Skills - Union Program
Tutorials Arena
11/10/2024
9:09
Learn Programming Technique C to Master Skills - Second Program( Call by Reference)
Tutorials Arena
11/8/2024
13:04
Learn Programming Technique C to Master Skills - Double Dimension Array Program
Tutorials Arena
10/20/2024
3:40
Learn Programming Technique C to Master Skills - Array of Pointer Program
Tutorials Arena
11/9/2024
10:56
Learn Programming Technique C to Master Skills - Loop With If Statement Program
Tutorials Arena
10/13/2024
8:45
Learn Programming Technique C to Master Skills - Explanation of Pointer - I
Tutorials Arena
11/8/2024
5:02
Learn Programming Technique C to Master Skills - Third Program of Loop
Tutorials Arena
10/17/2024
12:03
Learn Programming Technique C to Master Skills - Array of Structure Program
Tutorials Arena
11/10/2024
11:51
Learn.Programming Technique C to Master Skills - Steps to work in CodeBlocks Steps to create your first program in C
Tutorials Arena
9/29/2024
4:22
Learn Programming Technique C to Master Skills - Pointer And Arrays Program
Tutorials Arena
11/9/2024
8:47
Learn Programming Technique C to Master Skills - Structure Pointer
Tutorials Arena
11/30/2024
7:16
Learn Programming Technique C to Master SkillsCharacter String First Program
Tutorials Arena
11/19/2024