I had 2 do while loops in the same function and kept getting and exception thrown by the second loop. I was confused why the do in the second loop was executing when the logic in the second while was not met. When you explained do while runs once then checks logic, it was a revelation moment. Thank you for saving me from nullpointerexception hell!
wow awesome I really understand everything ! I have an exam on Friday so I will certainly be able to understand the question and do the task on compiler
i guess Im randomly asking but does someone know of a way to log back into an instagram account? I was stupid lost my account password. I appreciate any assistance you can give me
@Duncan Beckham I really appreciate your reply. I got to the site thru google and I'm trying it out atm. I see it takes a while so I will get back to you later with my results.
Would you be able to do an example of do-while loop but instead of integer to terminate the program we use a string to stop the program? e.g. while(i == "stop")
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); System.out.print("please enter a value between 1 and 10: "); long i = s.nextInt(); do { System.out.print(i + " is wrong please try again: "); i = s.nextInt(); } while (i > 10 || i < 1); System.out.println(i + " is correct"); } } here's mine, a bit different but works the same ^^.
package ayushi; import java.util.Scanner; public class Main { public static void main(String[] arg) { Scanner intput = new Scanner(System.in); System.out.println("enter your number:"); int a =intput.nextInt(); do{ System.out.println(a + "is in not between 1 and 10"); a =intput.nextInt(); }while (1>a || a>10) ; System.out.println(a + "is in between 1 and 10"); } }
Sir what if we enter our first number in between 1 and 10 Our program will ask us again to enter a number So we can use if else statements to solve this one In if block write condition as usual In else write do while It gives us effective output
I just wrote the same program as the tutor in the vid, and entered a number between 1 and 10 in the first go. It didn't ask us "again" to enter a number. Better not to use if / else in this program, as who know in which go will the user enter the right number
hey, i know it's a pretty late reply, but still I wanna say this: if we enter 1st number between 1 and 10, it will not ask for input again cause if the first input is within the range then it will not go into the while loop, it will straight come out of the loop and will print
basically the code runs at least once with do while loop. even if condition is false in a regular while loop if the condition is false the code never runs
Finally I got clear difference between do while and while loops. Thank you for your support to the entire world
appo poi umbu da punda
Sirr...you are just amazing!!!!... U just cleared my every doubt...
I had 2 do while loops in the same function and kept getting and exception thrown by the second loop. I was confused why the do in the second loop was executing when the logic in the second while was not met. When you explained do while runs once then checks logic, it was a revelation moment. Thank you for saving me from nullpointerexception hell!
Great explanations. Straight to the point thank you
Ay man! I really appriciate your teaching videos. I just want to let u know that keep fighting and keep living. Dont give up! I hope God bless you.
Really worth it!!. I will give your reference in my school assignments too 💜💜
i just love this man
wow best and most clear explanation
i luv ur videos so much!!! the exercises are so useful and ur teaching is to the point
thank you sir!
thank you so much bro, it was amazing, i appraciate you
wow awesome I really understand everything ! I have an exam on Friday so I will certainly be able to understand the question and do the task on compiler
i guess Im randomly asking but does someone know of a way to log back into an instagram account?
I was stupid lost my account password. I appreciate any assistance you can give me
@Bryce Reece instablaster =)
@Duncan Beckham I really appreciate your reply. I got to the site thru google and I'm trying it out atm.
I see it takes a while so I will get back to you later with my results.
@Duncan Beckham It did the trick and I now got access to my account again. Im so happy!
Thanks so much, you saved my ass!
@Bryce Reece happy to help =)
You got a new subscriber, thank you
Great tutorial ever👍
Excellent ...Thanks for you videos..
thank you very much...
please upload videos fast..
when neso is going to start ds and algorithms
A nice explanation! ty so much
This was helpful in learning loops but everywhere I go, people use INT. most of my assignments want Strings.
Would you be able to do an example of do-while loop but instead of integer to terminate the program we use a string to stop the program? e.g. while(i == "stop")
Thank you so much sir keep it up please upload videos the descrite mathematics full course
excellent explanation.... thanks.
Awesome vid!
That was amazing thank you
sir i am a lot of learn from you .
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.print("please enter a value between 1 and 10: ");
long i = s.nextInt();
do {
System.out.print(i + " is wrong please try again: ");
i = s.nextInt();
} while (i > 10 || i < 1);
System.out.println(i + " is correct");
}
}
here's mine, a bit different but works the same ^^.
Thanksssssss
package ayushi;
import java.util.Scanner;
public class Main {
public static void main(String[] arg) {
Scanner intput = new Scanner(System.in);
System.out.println("enter your number:");
int a =intput.nextInt();
do{
System.out.println(a + "is in not between 1 and 10");
a =intput.nextInt();
}while (1>a || a>10) ;
System.out.println(a + "is in between 1 and 10");
}
}
what ide do you use?
Intellij idea
WHAT IS THE SYNTAX?
Great
supe explaination
good video , oRayt?
import java.util.Scanner;
public class a{
public static void main(String[]args){
Scanner n=new Scanner(System.in);
int input;
do
{
System.out.print("Enter number between 1 and 10 :");
input=n.nextInt();
if(input>1&&input1&&input
Sir what if we enter our first number in between 1 and 10
Our program will ask us again to enter a number
So we can use if else statements to solve this one
In if block write condition as usual
In else write do while
It gives us effective output
I just wrote the same program as the tutor in the vid, and entered a number between 1 and 10 in the first go. It didn't ask us "again" to enter a number. Better not to use if / else in this program, as who know in which go will the user enter the right number
@@a.human. Using if and else blocks increases the efficiency of program and helps to solve many test cases
@@jayanth5032 i believe we can it is more efficient to use it in while loop
hey, i know it's a pretty late reply, but still I wanna say this: if we enter 1st number between 1 and 10, it will not ask for input again cause if the first input is within the range then it will not go into the while loop, it will straight come out of the loop and will print
👍👍
Okau HABIBI
I cant see the difference its the same
basically the code runs at least once with do while loop. even if condition is false
in a regular while loop if the condition is false the code never runs
nice video but accent was lit
That's Arabic accent for you
can you talk little bet slower plz