Skip to player
Skip to main content
Skip to footer
Search
Connect
Watch fullscreen
Like
Comments
Bookmark
Share
Add to Playlist
Report
Learn Programming Technique C to Master Skills - Single If Statement Program (Flow Chart)
Tutorials Arena
Follow
10/12/2024
Category
📚
Learning
Transcript
Display full video transcript
00:00
Hi, this Sandeep. Today I'm going to start one-way selection program. When I talk about
00:10
one-way selection program, we are going to use the if statement for one time. These types
00:18
of programs are of conditions in which we use conditions, in which the conditions are
00:26
given and on the basis of which we take the decision and we do the work. So let us understand
00:34
this program, what the program says. First of all, I'm going to explain this program
00:40
in flowchart. Then I'm going to implement the program in C. So here's the program. A
00:49
shopkeeper gives discount to its customer on their purchase. If the customer purchasing
00:56
amount is greater than equals to 10,000, then the customer is going to get 10% commission.
01:03
If the customer's purchasing amount is less than 10,000, then no discount.
01:09
Okay, so the purchasing amount is greater than equals to 10,000, then 10%. If the purchasing
01:14
amount is less than 10,000 of a customer, then no discount. What we have to do, we have
01:21
to calculate the discount and the net amount in which customer purchase the goods. So we
01:26
have to calculate two things. One is discount and also the amount in which the customer
01:34
purchase the goods. That is from the actual amount, the discount is going to deduct and
01:40
we are going to get the amount in which the customer purchase the goods. Okay, now whenever
01:46
we read the program, the first thing which should come in our mind that how many variables
01:51
should we take. So when we read the program, we understand that we have to take three variables,
02:00
P for purchase, D for the discount and N for the amount in which the customer purchase
02:08
the goods. Okay, now inside the decision box, we have to write down the things according
02:15
to the question that if the purchasing amount is greater than equals to 10,000, then 10%
02:21
is calculated and if the purchasing amount is less than 10,000, then it should display
02:25
what no discount. So let us do the dry run and see how the things will work. I'm going
02:32
to input the purchasing amount of the first customer. Suppose the purchasing amount of
02:39
the first customer is what 25,000. It made the purchase of 25,000. It will come to the
02:48
decision part. If 25,000 greater than 10,000, yes, 25,000 is greater than 10,000. It will
02:55
come to the yes part. Inside P, it is what 25,000 as the question says that if customer
03:04
purchase is greater than equals to 10,000, then 10% discount. So here's the formula
03:09
of it to calculate the 10% discount. Inside P, it is 25,000 into 10 upon 100. So the calculation
03:18
to get the discount that is performed and the discount is stored inside T.
03:28
Now, as we got the discount that is 2,500, we also have to calculate the amount in which
03:36
the customer purchased the goods. So here is the calculation work. n equals to P minus
03:42
D. What is inside P? It is 25,000. What is inside D? It is 2,500. So from 25,000, 2,500
03:51
is going to deduct and the amount is worth 22,500. In this amount, the customer purchased
04:00
the good after deduction of discount. So good is purchased on this amount. Then we
04:08
have displayed the discount in the net amount.
04:11
Now, let us again run the program with some different amount. Suppose the purchasing amount
04:21
of the second customer that is worth 500 and he made the purchase of only 500. So if
04:29
500 greater than 10,000, here the condition will get false. It will come to the no part.
04:35
And according to the question, if the purchase amount is less than 10,000, no discount. It's
04:40
going to display what? No discount. And then what is stop?
04:47
So in the next video, I'm going to implement the same program in C. Thanks.
Recommended
2:58
|
Up next
Learn Programming Technique C to Master Skills - Nested If Statement Program (Flow Chart)
Tutorials Arena
10/12/2024
5:29
Learn Programming Technique C to Master Skills - Continuous If Program (Flow Chart)
Tutorials Arena
10/8/2024
4:57
Learn Programming Technique C to Master Skills - Loop With If Statement Program ( Flow Chart )
Tutorials Arena
10/13/2024
3:51
Learn Programming Technique C to Master Skills - First Program of Loop (Flowchart)
Tutorials Arena
10/13/2024
3:52
Learn Programming Technique C to Master Skills - Second Program of Loop (Flow Chart)
Tutorials Arena
10/17/2024
3:20
Learn Programming Technique C to Master Skills - Multiple Selection Program (Flow chart)
Tutorials Arena
10/12/2024
5:14
Learn Programming Technique C to Master Skills - Single If Statement Program Explanation
Tutorials Arena
10/12/2024
4:39
Learn Programming Technique C to Master Skills - If... else if Statement Program (Flowchart)
Tutorials Arena
10/8/2024
12:06
Learn Programming Technique C to Master Skills - Continuous If Statement Program
Tutorials Arena
10/8/2024
3:27
Learn Programming Technique C to Master Skills - Third Program of Loop ( Flow Chart)
Tutorials Arena
10/17/2024
7:56
Learn Programming Technique C to Master Skills - Nested If Statement Program
Tutorials Arena
10/12/2024
4:55
Learn Programming Technique C to Master SkillsCharacter String Second Program (Flowchart)
Tutorials Arena
11/19/2024
4:01
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( Flow Chart )
Tutorials Arena
10/13/2024
10:56
Learn Programming Technique C to Master Skills - Loop With If Statement Program
Tutorials Arena
10/13/2024
5:15
Learn Programming Technique C to Master SkillsCharacter String Third Program (Flowchart)
Tutorials Arena
11/19/2024
9:20
Learn Programming Technique C to Master Skills - Union Program
Tutorials Arena
11/10/2024
8:06
Learn Programming Technique C to Master Skills - Linked List ( First Program)
Tutorials Arena
11/30/2024
6:03
Learn Programming Technique C to Master Skills - Linked List ( Second Program)
Tutorials Arena
11/30/2024
9:09
Learn Programming Technique C to Master Skills - Second Program( Call by Reference)
Tutorials Arena
11/8/2024
16:34
Learn Programming Technique C to Master Skills - FIle Handling ( Explain of Program with help of Diagram)
Tutorials Arena
11/18/2024
5:02
Learn Programming Technique C to Master SkillsCharacter String Fourth Program (Flowchart)
Tutorials Arena
11/19/2024
4:17
Learn Programming Technique C to Master Skills - Linked List ( Create Node Program)
Tutorials Arena
11/30/2024
2:41
Learn Programming Technique C to Master Skills - Explanation of First Program of C Language in Flowchart
Tutorials Arena
10/8/2024
12:25
Learn Programming Technique C to Master Skills - Call By Reference Program
Tutorials Arena
11/8/2024
2:44
Learn Programming Technique C to Master Skills - Switch Case Program ( Use of Character Value)
Tutorials Arena
10/19/2024