#include int main(){ int a,b,c; printf("Enter the three numbers:"); scanf("%d %d %d",&a,&b,&c); if(a>b) { if(a>c) printf("%d is largest",a); else printf("%d is largest",c); } else { if(b>c) printf("%d is largest",b); else printf("%d is largest",c); } return 0; }
@@babluranga1421 bro its too lengthy see use the logical and #include int main() { int a,b,c; printf("enter three numbers"); scanf("%d %d %d",&a,&b,&c); if (a>b && a>c) printf("%d is the greatest number",a); if (b>c && b>a) printf("%d is the greatest number",b); if (c>b && c>a) printf("%d is the greatest number",c);
Thanks a lot, mam!!!!! I am a 10th grader and I have IT classes, in school and we were learning c programming I missed a class in which nested if statement was taught...I forgot to ask my teacher and tomorrow is my exam!!!! Your explanation worked wonders for me...Thanks a ton!!!!
Mam u are genius I does not understand the matter of nested if statement. Then I watch your video. Even I confidently say that I understand the matter. Thank you so mach mam
Hello ma'am this is quite useful series your videos are the best i have never seen before like this type of explanation of each topic And 1 question how many sweaters and jersies do you have ??
Mam in these if we write two programs with logical "and" ooerator then if anyone is false then it directly goes to outer else ( don't go on inner else ) and but if we write both conditions seperately in two if manner then only we get inner else statement when inner if statement became false . Check this on 15:04 in your video you say wrong I think please make me correct if I wrong otherwise the correct video ❤️
That was great really to clear out my all confusions 😃. I prefer Everyone should learn from your channel. Lots of love from Balochistan❤. Thank you so much mam. God bless u ever. ❤❤
Mam, when you have used same if for both conditions if the age condition is false i.e less than 50 then the salary will be incremented 5000 but it should be only 3000 know.
Ma'am thank you so much for such an amazing c language lectures.. You helped me a lot...😃 Thank you so much maam..❤ Maam plzz c++ ki playlist complete kr dejiye.. We are waiting...
//Write a C program to find maximum between three numbers. #include int main() { int a,b,c; a=b=c=0; printf("Enter 1st number: "); scanf("%d",&a); printf("Enter 2nd number: "); scanf("%d",&b); printf("Enter 3rd number: "); scanf("%d",&c); if(a>b) { if(a>c) { printf("%d is greater",a); } else { printf("%d is greater",c); } }
else
{ if(b>c) { printf("%d is greater",b); } else { printf("%d is greater",c); } } }
Thank you mam :) for your Efforts.... Love from Khammam..
Dear madam is it possible to convert nested if else condition into ternary operator because we know ternary operator is one type of if else replica.. so if yes than plz requesting you to provide explanation in detail... Thanku and god bless 😊😊😊
Mam, for printing the updated salary like suppose 55000 if we enter the amount as 45000 , you haven't used printf for that updated salary hence output cannot be displayed on screen
//Edited://Task done mam! //Edited://Code for greatest among three no. by if and else. include void main(){ int a,b,c; printf("Enter your first no.="); scanf("%d",&a); printf("Enter your second no.="); scanf("%d",&b); printf("Enter your third no.="); scanf("%d",&c); if(a>b){ if(a>c){ printf("First no. is greatest "); } } else{ printf("First no. is smallest "); } if(b>a){ if(b>c){ printf("Second no. is greatest "); } } else{ printf("Second no. is smallest "); } if(c>a){ if(c>b){ printf("Third no. is greatest "); } } else{ printf("Third no. is smallest "); } }
Assignment work done ✅ void main() { float A, B, C; printf(“Enter three values ”); scanf(“%f %f %f ”,&A, &B, &C); printf(“ Largest value is:”); if(A > B) { if(A > C) printf(“%f ”,A); else printf(“%f ”,C); } else { if(C > B) printf(“%f ”,C); else printf(“%f ”,B); } } OUTPUT Enter three values: 5 8 24 Largest value is 24 😊😊✌️
12:20 how can we consider the second else case here.... Bcz an else can't be there without any if... Since there is only one if how we treat the second else statements there..?
madam if we use two conditions by using and operater in first if statement then what is the use of else in first parenthesis of if statements bcoz in first if statement is false it will jump to else after first parenthesis so pls can u clarify this ..
I cannot understand how the last else will be executed..... Because by using and operator we are checking both condition age and salary ... So suppose if the age of a person is greater than 50 and salary more than 60000 then if condition is not satisfied then 1st else loop will be executed. (My question is why the 2nd else loop will not be executed) Now my 2nd question is If the age of the person is less than 50 then how compiler will understand which else statement should be executed 1st else or 2nd else?.... Pls ans.
For your first question: In logical and, once the first condition is false then the second will be ignored whether it is true or not. Since according to the statement on the first else block the salary had to be less than 60, 000 in order to execute and the logical and ignores that condition since the first is false, that first else will not be executed. However, if the first condition were true, then it would proceed to the next condition, and even though the second was false, the first else block will then be executed. For your second question: it depends on how the structure of your statement is, that's why you need to pay attention to your structure as regards the use of curly braces to keep the conditions in check. Without them, all the statements after the first block for the first if condition statement may be printed on your standard output whether or not the conditions were true. I think you should watch her previous tutorials on if statements. Thank you
int main() { int a,b,c; printf("enter three numbers:"); scanf("%d %d %d",&a,&b,&c); if(a>b) { if(a>c) printf("a is the largest"); else printf("c is the largest"); } else printf("b is the largest"); }
Hi Teacher, is it possible to add conditions to inner if statements that are not related with each other.. Like for the example you as you mentioned in the example if I want to check grapes as well is it possible to add that statement..
The help you have rendered with these videos knows no bounds. Thank you so much, Tutor Jenny
first time in 5 years, I am getting most of my concepts clear. this series is awesome.
5 saal se first year me hai kya lamde
Really good
@@akshaychavan3597 hey brother what are you doing this time job or another work
@@AbhishekSahu-z1e yes, it's a job. Why do you ask ?
#include
int main(){
int a,b,c;
printf("Enter the three numbers:");
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
if(a>c)
printf("%d is largest",a);
else
printf("%d is largest",c);
}
else
{
if(b>c)
printf("%d is largest",b);
else
printf("%d is largest",c);
}
return 0;
}
👍
perfact
Very good
Text book answer
@@babluranga1421 bro its too lengthy see use the logical and
#include
int main()
{
int a,b,c;
printf("enter three numbers");
scanf("%d %d %d",&a,&b,&c);
if (a>b && a>c)
printf("%d is the greatest number",a);
if (b>c && b>a)
printf("%d is the greatest number",b);
if (c>b && c>a)
printf("%d is the greatest number",c);
}
Thanks a lot, mam!!!!! I am a 10th grader and I have IT classes, in school and we were learning c programming I missed a class
in which nested if statement was taught...I forgot to ask my teacher and tomorrow is my exam!!!! Your explanation worked wonders for me...Thanks a ton!!!!
Mam I didn't even know what is c
But mam with the support of u I learnt every basics things about programs
✅Hey mam what is Lamba🤷😊
I never learnt any thing from my lectures every thing learnt from your videos thank you mam
Thank you so much Jenny, you just simplify my cs50 course. This is so helpful and i love your traditional way of teaching.
Mam u are genius I does not understand the matter of nested if statement. Then I watch your video. Even I confidently say that I understand the matter. Thank you so mach mam
the best tutor in the world, God bless u dear Jenny
U usually gives explanation with ur heart core thanks mam
its for beginner what about advance Maam
your teaching method is supper say bahot uper.
Thanks tutor Jenny for the lectures
If(a>b)
{.
If(a>c)
{
printf("a is big");
}
else
{
printf("c is big")
}
}
else
{
prinf(" b is big")
}
Mam you are Explanation is Good on c-programming i am easily understand that concept Nested if Thank you mam you are teach very well.
Hello ma'am
this is quite useful series
your videos are the best i have never seen before like this type of explanation of each topic
And 1 question how many sweaters and jersies do you have ??
You are very experienced teacher so good teaching thank you ma'am.
Explination of concepts are good
also
make the videos on JAVA programming
untill waiting for that ...,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
really u are good at programing i seen all vedios of u it is very use full to me
Mam in these if we write two programs with logical "and" ooerator then if anyone is false then it directly goes to outer else ( don't go on inner else ) and but if we write both conditions seperately in two if manner then only we get inner else statement when inner if statement became false . Check this on 15:04 in your video you say wrong I think please make me correct if I wrong otherwise the correct video ❤️
Yes I also got the same doubt.
Have you got the solution to it?
Aoa Your Teaching Method is so good 👍
Your teaching technique is so great Mam.
That was great really to clear out my all confusions 😃. I prefer Everyone should learn from your channel. Lots of love from Balochistan❤. Thank you so much mam. God bless u ever. ❤❤
Mam, when you have used same if for both conditions if the age condition is false i.e less than 50 then the salary will be incremented 5000 but it should be only 3000 know.
Mam really you are awesome. I was struggling to get idea and you explained very simply 😊
SuperMarket example helps me to understand 🤗🤗
Awesome video, keep up the great work! :)
Thank you ma'am for teaching in easy way
Hihgly better explained more my Lecturer. thanks a lot Madam!
3 numbers,find maximum among 3 numbers using nested if
Your lectures are very helpful for us
Ma'am thank you so much for such an amazing c language lectures..
You helped me a lot...😃
Thank you so much maam..❤
Maam plzz c++ ki playlist complete kr dejiye..
We are waiting...
Ai Bata jin hausa
//Write a C program to find maximum between three numbers.
#include
int main()
{
int a,b,c;
a=b=c=0;
printf("Enter 1st number: ");
scanf("%d",&a);
printf("Enter 2nd number: ");
scanf("%d",&b);
printf("Enter 3rd number: ");
scanf("%d",&c);
if(a>b)
{
if(a>c)
{
printf("%d is greater",a);
}
else
{
printf("%d is greater",c);
}
}
else
{
if(b>c)
{
printf("%d is greater",b);
}
else
{
printf("%d is greater",c);
}
}
}
Thank you mam :) for your Efforts....
Love from Khammam..
Happy that I did the assignment in two ways, if-else statement and with ternary operators, feels good.
Dear madam is it possible to convert nested if else condition into ternary operator because we know ternary operator is one type of if else replica.. so if yes than plz requesting you to provide explanation in detail... Thanku and god bless 😊😊😊
Thank you 😊💕 mam so much this solved my doubts you explained so good
Mam, for printing the updated salary like suppose 55000 if we enter the amount as 45000 , you haven't used printf for that updated salary hence output cannot be displayed on screen
Me after lecture if i have doubts 💨🏃♂🏃♂ to jenny's lectures
anyways thanks so much🙏🙏🙏
//Edited://Task done mam!
//Edited://Code for greatest among three no. by if and else.
include
void main(){
int a,b,c;
printf("Enter your first no.=");
scanf("%d",&a);
printf("Enter your second no.=");
scanf("%d",&b);
printf("Enter your third no.=");
scanf("%d",&c);
if(a>b){
if(a>c){
printf("First no. is greatest
");
}
}
else{
printf("First no. is smallest
");
}
if(b>a){
if(b>c){
printf("Second no. is greatest
");
}
}
else{
printf("Second no. is smallest
");
}
if(c>a){
if(c>b){
printf("Third no. is greatest
");
}
}
else{
printf("Third no. is smallest
");
}
}
thankyou soo much mam !! your the best
Wow! Mam,you are the best**⭐
Assignment work done ✅
void main()
{
float A, B, C;
printf(“Enter three values
”);
scanf(“%f %f %f ”,&A, &B, &C);
printf(“
Largest value is:”);
if(A > B)
{
if(A > C)
printf(“%f
”,A);
else
printf(“%f
”,C);
}
else
{
if(C > B)
printf(“%f
”,C);
else
printf(“%f
”,B);
}
}
OUTPUT
Enter three values:
5 8 24
Largest value is 24
😊😊✌️
well thanks , i didn't know you can include if in else
Thank u mam.these videos r very helpful ...
Thank u mam for thinking much about us
If we write many conditions using logical and in if statement then it is not more called nested if right mam..?
Ma'am please start classes on java programming language too 💙
Thank you Mam for ur awesome teaching
Your teaching method is very nice.if once set in mind your lectures it Can never forget.
And one more thing
ते fast writing चा आवाज खूप भारी दिलाय.😅😅
Watched and Understood ❤
So nice explanation ❤️
Thankyou aunty aab me pass hojaunga 😮
Thanks a Lot Mam
Mam I had solved the assignment given by you to find maximum of two numbers
Thanks for clearing my doubt maam
Explain the condition 2 what if it is false and if there is any local variable how is the control flow
Maximum no program executed.
Thank ma'am for teaching this.
12:20 how can we consider the second else case here.... Bcz an else can't be there without any if... Since there is only one if how we treat the second else statements there..?
Yes... I also have same doubt !
Yes..... I also have same doubt!
Superb explanation 👍
❤ meet in jannah mam
Just learning c thx mam
Nice explanation ❤️❤️❤️👍👍👍
Mam..your look ..your voice all are similar with Neha mam.....vedantu maths teacher ♥️
madam if we use two conditions by using and operater in first if statement then what is the use of else in first parenthesis of if statements bcoz in first if statement is false it will jump to else after first parenthesis so pls can u clarify this ..
example was best
It's amazing mam
If. We will do it on 16 bit compiler the output of program will be unpredictable as we are using salary as int.
You are an Angel sent from heaven
I got the maximum among three numbers mam
Mam you are incredible👍😍
Thanks from kashmir
I HAVE DONE THIS PROGRAM WITH ONE STATEMENT BY USING LOGICAL OPERATOR &&.
mam in this programme you have forgoted to write
salary=salary+X;
printf("%d is the salary",salary);
Thanks madam hopes to join India soon
Your videos are awesome 🥂🌈
Really good 👍
Thank you mam so much❤️❤️❤️❤️❤️😘😘😘
I cannot understand how the last else will be executed..... Because by using and operator we are checking both condition age and salary ... So suppose if the age of a person is greater than 50 and salary more than 60000 then if condition is not satisfied then 1st else loop will be executed. (My question is why the 2nd else loop will not be executed) Now my 2nd question is If the age of the person is less than 50 then how compiler will understand which else statement should be executed 1st else or 2nd else?.... Pls ans.
I need answer as well
We can use logical OR instead of logical AND
For your first question: In logical and, once the first condition is false then the second will be ignored whether it is true or not. Since according to the statement on the first else block the salary had to be less than 60, 000 in order to execute and the logical and ignores that condition since the first is false, that first else will not be executed. However, if the first condition were true, then it would proceed to the next condition, and even though the second was false, the first else block will then be executed.
For your second question: it depends on how the structure of your statement is, that's why you need to pay attention to your structure as regards the use of curly braces to keep the conditions in check. Without them, all the statements after the first block for the first if condition statement may be printed on your standard output whether or not the conditions were true. I think you should watch her previous tutorials on if statements.
Thank you
Thnku so much 👍🏼👍🏼
int main()
{
int a,b,c;
printf("enter three numbers:");
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
if(a>c)
printf("a is the largest");
else
printf("c is the largest");
}
else
printf("b is the largest");
}
its wrong bro
Thankyou mam ❤️❤️
ma'am in single if we can' t use double else,it will give error
yessss, how to fix?
Then again use if instead of second else
Excellent 😊
Video starts at 2:35
can we use else if to write a program to find greatest of 3 numbers
What is the difference between
200>A>100 And 200>A&&A>100
&& acts as a operator i guess
Great work mam
Great..
Hi Teacher, is it possible to add conditions to inner if statements that are not related with each other..
Like for the example you as you mentioned in the example if I want to check grapes as well is it possible to add that statement..
Woww nice explanation
Amazing ❤❤
Mam since integer range is from _ 32768 to + 32768 ,here we cannot use the condition salary less than 60000
Use long int🥴
If your computer is 32 bits or 64 bits then you can use it, else you should use long int
Lec starts 2:33
leaps are in motion ocean to ocean to ocean
Thankyou thankyou very much!!!$$
Great effort maaaaaammmm
Thank u so much maam
Madam can we use inner if condition in else condition of nested if
Excellent
I need notes
That last else will show error misplaced else
Mam,ur flow chart is not correct...u forgot to mention if condition 2 is false then else statement has to be executed..
thanks