Skip to main content

Command Palette

Search for a command to run...

javascript question and answer

Published
1 min readView as Markdown
A

Hello, everyone! My name is Aditya Gupta, and I'm thrilled to welcome you to my programming language blog and project. As a passionate web developer, I've dedicated myself to exploring the vast world of programming languages and sharing my knowledge with fellow enthusiasts like you. Through my blog, I aim to provide informative and engaging content that will help you navigate the intricacies of various programming languages, including Python, JavaScript, Java, and more. Additionally, I'm actively working on an exciting project that combines my expertise in web development and programming languages. Join me on this thrilling journey as we delve into the fascinating realm of code and unleash our creativity together. Let's write beautiful and functional programs that empower us to shape the digital landscape.

ust for beginners, I believe you are enjoying

1 . user se number maango usmein 10 add kro and agr wo 10 add krne pr 20 se jada ho jaaye to bolna hello nahito bolna hey


var num= prompt("number do");
var newnum = Number(num)+10;
if (newnum>20){
    console.log("hello");
}
else{
    console.log("hey");
}

2. user se number maango 2 bar and dono ko add kro and agr dusre number ki last digit us added number se chhoti hai to print kro hello

var num1=  Number(prompt("number dedo"));
var num2=  Number(prompt(" ek aur number dedo"));
var add = num1+num2;
if(num2%10<add){
    console.log("hello");

}
else{
    console.log("hye");
}

ser se do password maango an agr match kr jaaye log in kro nahi to mna kr dod


var pass1=prompt("pass dedo");
var pass2=prompt("sec pass dedo");
if (pass1 === pass2){
    console.log("login allowed");

}
else{
    console.log("login not allowed");
}

even and odd


var num = prompt("ek number do");

num=Number(num);

if (num%2===0){
    console.log("even");
}
else{
    console.log("odd");
}
12 views