#12 Conditional Statements If Else in JavaScript

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

More Learning :

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

n=4
If(n%2==0)
console. log(evennumber) ;
Else if(n%2==1)
console. log( odd number) ;
Else
Console(end the program)

srilakshmim
Автор

The ternary operator would be a nice addition to learning how if-else statements work.

TomDoesTech
Автор

Wow sir you finally changed the contrast thank you much❤️ we love your content👍

CultOfJ
Автор

// Given assignment
let num1 = 3
if ((num1 % 2) == 0) {
console.log("num1 is even")
} else {
console.log("num1 is odd")
}

s.m.sazidarman
Автор

FInding if a number is Even or Odd, time stamp 12:00
function oddEven(num) {
if(num % 2 === 0) {
num = 'even';
}else {
num = 'odd';
}
return num;
}
console.log(oddEven(4));

sigmatronX
Автор

Timestamp 12:00
Checking if number is odd or even:

let num = 232;

let result = num % 2 ;

if (result ===0){
console.log("num is even")}
else console.log("num is odd")

// output: num is even

kalyanimathur
Автор

You made if else conditions complicated for beginners in other videos its showcased very simply and clearly.

abhinandtp
Автор

Clean and nice

let n = 12;
if(n/2 === 0){
console.log("even")
};
console.log("odd")

sahul._
Автор

very very basics that no one is telling but are. that's awesome!! plz make more videos for this playlist

chetanram
Автор

Question for Video length 9:20 minutes.. The logical operator to you use would be &&

ZeenHealthHolistic
Автор

Are you going to create videos on C language too, it will be very helpful for me and my college mate, cause I have problem to learn it, and the way you taught java last Sunday was phenomenal

vanshrewaskar
Автор

let a = prompt("enter a value");
if(a%2 == 0){
console.log("even");
}
else{
console.log("odd");
}

gowripriya
Автор

I found a simpler way, you can only compare the remaining two values:



let num1 = 15;
let num2 = 10;
let num3 = 20;



if (num1 > num2 && num1 > num3) {
console.log("num1 is greatest");
}
else if (num2 > num3) {
console.log("num2 is greatest");
}
else {
console.log("num3 is greatest")
}


console.log("Exit")

okechirichard
Автор

5:35 is Eye Opening to me 😍😍😍😍.
9:25 its very tough for me to guess 😞

martinintilt
Автор

"yeee" lololol IDK why that made me laugh so hard. I love the way you teach....thank you so much.

ImKayori
Автор

Sir I know the series is very helpful and informative but there is a huge delay in videos. For completing the actual js client part that the series aimed at, it will take 4-5 months i think, please consider that Sir :)

mehulbisht
Автор

Let num = 15;
If(num % 2 === 1){console.log(‘num is an odd number’)}
Else{console.log(‘num is an even number);}

isiborjohnson
Автор

I/p:-
Let n=12;
If(n%2==0)
{
Console.log(number is even);
}
else
{
console.log(number is odd);
}
O/p:-number is even.

sampathkumar
Автор

If(n%2==0) //We are checking Number is divided exactly by 2 or not
console.log("even");
else
console.log("odd");

maheshchaubey
Автор

at 9.18 the operator we use is &&

RamuPoojari