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 - If... else if Statement Program (Flowchart)
Tutorials Arena
Follow
10/8/2024
Category
š
Learning
Transcript
Display full video transcript
00:00
Hello, everyone. This is Sandeep. In the last video, I explained one-way selection program.
00:09
I'm going to explain program of two-way selection, almost the same program. Only the thing is
00:16
that here I have to take what two times decision. So the program is what a shopkeeper gives
00:22
a discount to its customer on their purchase. If the purchasing amount of the customer is
00:29
greater than or equals to 10,000, then it's going to get 10% commission. But if the purchasing
00:36
amount of the customer is greater than or equals to 5,000, then the customer is going
00:41
to get 5%. And if the purchasing amount is less than 5,000, then customer is not going
00:49
to get any discount. So if the purchasing amount is greater than or equals to 10,000,
00:55
then 10% discount. If the purchasing amount is greater than or equals to 5,000, that
01:00
means the purchasing amount is between 5,000 and 10,000. The amount is between 5,000 and
01:07
10,000. Then the customer is going to get 5% discount. And if the purchasing amount
01:13
is less than 5,000, then no discount. Okay? So I've taken the three variables, P for purchasing
01:21
amount, D for discount, and for the amount, I'm going to input the purchasing amount
01:29
in P. If the condition here is true, that is greater than or equals to 10,000 and 10%
01:34
is going to calculate. If the condition falls here, so it will come to the no part. And
01:42
if the purchasing amount is between 5,000 and 10,000, according to the question, it's
01:47
going to be at 5%. That is going to calculate. That amount is going to calculate and then
01:52
display. And if here both the condition that falls, in that case that it only display what
01:59
no discount and then stop. So let us do the dry run. Suppose I input the purchasing amount
02:05
of the customer that is what 50,000. It will come to the if statement. If 50,000 as inside
02:14
P, it is 50,000. 50,000 greater than 10,000. Yes, 50,000 is greater than 10,000. 10% is
02:22
going to calculate and the resulted value is going to store inside D. Okay? Then from
02:29
the actual purchasing amount, the discount is going to deduct and the net amount in which
02:36
the customer purchase the goods, which is there inside N, it's going to store. Then
02:41
I have used the print statement to print the discount in the net amount and stop. Okay?
02:49
So as the formula here applied, so discount will be calculated over 5,000 and it's going
02:56
to deduct that is 50,000 minus 5,000 that is 45,000 and both the things are going to display.
03:04
Okay? Now again I'm going to run. Now this time the customer having the purchasing
03:12
amount what is that is 8,000. So another purchase, another customer have made the purchase
03:18
of 8,000. Okay? So it will come here if 8,000 greater than 10,000. Here the condition is false.
03:25
It will come to the no part. If 8,000 greater than 5,000. Yes, the condition is true. According
03:32
to the question, 5% is going to calculate. So it will calculate. The resulted value is going to
03:37
store inside D that is what 400. Then the net amount is going to calculate that is 7,600 that
03:49
is 800 minus 400. So 7,600 that is the amount in which customer purchase the goods and then
03:56
it's going to display. Okay? Now let us understand with the amount of another customer that is
04:07
4,000. If purchasing amount is of another customer is 4,000. So if 4,000 greater than 10,000 here
04:15
the condition is false. It will come to the no part. If 4,000 greater than 5,000 here also
04:21
condition is false. It will come to the no part and going to display with no discount and then
04:27
stop. So very easy. I hope you understand in the flowchart. In the next video, I will make the
04:33
same program in C. Thanks.
Recommended
8:32
|
Up next
Learn Programming Technique C to Master Skills - If .... else if Statement Program
Tutorials Arena
10/8/2024
2:58
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:54
Learn Programming Technique C to Master Skills - Single If Statement Program (Flow Chart)
Tutorials Arena
10/12/2024
4:57
Learn Programming Technique C to Master Skills - Loop With If Statement Program ( Flow Chart )
Tutorials Arena
10/13/2024
3:28
Learn Programming Technique C to Master Skills - Switch Case Program ( Continue ...)
Tutorials Arena
10/19/2024
4:57
Learn Programming Technique C to Master Skills - Loop with If Statement Second Program Continue...
Tutorials Arena
10/17/2024
12:06
Learn Programming Technique C to Master Skills - Continuous If Statement Program
Tutorials Arena
10/8/2024
3:51
Learn Programming Technique C to Master Skills - First Program of Loop (Flowchart)
Tutorials Arena
10/13/2024
3:16
Learn Programming Technique C to MasterĀ Skills - First Program of Function ( Continue ...)
Tutorials Arena
11/3/2024
3:52
Learn Programming Technique C to Master Skills - Second 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
3:37
Learn Programming Technique C to Master Skills - Pointers And Arrays Program ( Continue...)
Tutorials Arena
11/9/2024
3:21
Learn Programming Technique C to Master Skills - Third Program - Call by Reference (continue...)
Tutorials Arena
11/8/2024
10:56
Learn Programming Technique C to Master Skills - Loop With If Statement Program
Tutorials Arena
10/13/2024
3:27
Learn Programming Technique C to Master Skills - Third Program of Loop ( Flow Chart)
Tutorials Arena
10/17/2024
4:25
Learn Programming Technique C to Master Skills - Linked List ( Add Node Program ) Continue...
Tutorials Arena
11/30/2024
4:55
Learn Programming Technique C to Master SkillsCharacter String Second Program (Flowchart)
Tutorials Arena
11/19/2024
5:14
Learn Programming Technique C to Master Skills - Single If Statement Program Explanation
Tutorials Arena
10/12/2024
3:20
Learn Programming Technique C to Master Skills - Multiple Selection Program (Flow chart)
Tutorials Arena
10/12/2024
3:30
Learn Programming Technique C to Master Skills - Third Program ( Passing Entire Array in Function ,continue...)
Tutorials Arena
11/9/2024
8:07
Learn Programming Technique C to Master Skills - Loop with if Statement Second Program
Tutorials Arena
10/17/2024
4:01
Learn Programming Technique C to Master Skills - Fourth Program of Loop ( Flow Chart )
Tutorials Arena
10/13/2024
5:15
Learn Programming Technique C to Master SkillsCharacter String Third Program (Flowchart)
Tutorials Arena
11/19/2024
5:36
Learn Programming Technique C to Master Skills - Selection Sort ( Continue...)
Tutorials Arena
11/1/2024