#18 While vs For Loop | Which to use and When?

preview_player
Показать описание

More Learning :

Рекомендации по теме
Комментарии
Автор

the answer is :


let num = 123456;
let num2="0";

while(num>0)
{
let remainder=num%10;
num2=num2*10+remainder;
num=parseInt(num/10);

}
console.log(num2);

podcastwithom
Автор

Best teacher on youtbe, Kudos to navin sir

utkarshgupta
Автор

Thanks for clearance I’ve been asking myself even my friends when and where to apply a certain loop method on projects. Then today am the one who’s gonna help others on that one. Watching different tutorials with different developers helps me a lot because I learn 10 times more than at school.

mphomanaka
Автор

Time stamp 1:14 //numbers 1 to 100 that are divisible by 3
let count = 0; // to contain how many numbers are divisible by three
for (let i = 1; i <= 100; i++) {
if (i % 3 === 0) {
console.log(i);
count++;
}
}
console.log(count);

sigmatronX
Автор

Assignment:
let num = 123456;
let num2 = 0;
while(num>0)
{
let num1= num % 10;
num2 = num2 *10 + num1;
num = parseInt(num/10);
}
console.log(num2);

Prashuva
Автор

numbers divisible by 3 for(int i = 3;i<=100;i+=3)

harsha
Автор

We will use if statement in for loop and condition is if(i%3==o) then print the value of i

mdsaqib
Автор

For outputing a range of numbers divisible by 3 you dont need that condition (i%3===0). You can simply increment the 'i' in your for loop by 3 and get same result. ie: -

for(let i = 0; i < 100; i += 3){
console.log(i)
}

paschalokafor
Автор

Thanks Navin!!
Here are Positive order loop i wrote.

let x=56789

let y=10000

while(y>=1)//Positive order
{
z=parseInt(x/y)
console.log(parseInt(z%10))
y=y/10;
}

bd
Автор

Answer 6:25
//Made by Anmol main
let value = 564782
let rev
while (value) {
rev = value % 10;
value = parseInt(value / 10)
console.log(rev);
}

clanhindustan
Автор

assignment:-
let num = 28374983;
let reverse = "";
while (num > 0) {
console.log(num % 10);
reverse += num % 10;
num = parseInt(num / 10);
}
convert = parseInt(reverse);
console.log(convert, typeof convert);

rithiknadar
Автор

by learning JS from here, can we become more familiar with development using js? and this playlist covers all the advanced points which a programmer should known for development ?? kindly help anyone

LetsRelaxABit
Автор

Very nice series Sir ... Hope you will cover till advanced of JavaScript, One request sir ... please make a dedicated series on DevOps ... Website Deployment, Docker, Kubernetes, Jenkins, Especially Azure or AWS please sir ...

thegreywalker
Автор

Sir, please make videos on Artificial intelligence and machine learning

sasi
Автор

my forloop never gets xecuted i need help

TheTechCritic
Автор

can we add && operator to for loop?

micheledory
Автор

Please make a video on java interview questions for freshers

kavyanj
Автор

please tell about best books for javascript

saivardhanreddy
Автор

1.19 // print the number divided by 3 between 1 to 100

for (let i = 1; i <= 100; i++){
if(i%3===0){
console.log(i);
}
}

sbqpxmn
Автор

HW:
let num = 564782, num2 = 0;
while(num > 0)
{
num2 = (num2 * 10) + (num % 10);
num = parseInt(num / 10);
}
console.log(num2);

Once Again Thanks Navin sir

jayantamondal