Posts

Showing posts from June, 2023

Day 34: Reverse Number of Number of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day34 of 100DaysCodingChallenge for  Reverse Number of input  Numbers  taken by the user. Code :  let n = prompt("Enter a Number : "); let n1 = n; let rev = 0, rem; while (n > 0) { //console.log(n % 10); //console.log(rev * 10); //console.log(rev * 10 + rem); //console.log(n /= 10); rem = n % 10; rev = rev * 10 + n % 10; n = Math.floor(n/10); } console.log("The Reverse Number of", n1, "is :", rev); Output :       Happy Coding:) Day 34 Of 100 Days Coding Challenge Thank you... 

Day 33: LCM of two numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day33 of 100DaysCodingChallenge for  LCM of two numbers input  Numbers  taken by the user. Code :  let a = prompt("Enter a : "); let b = prompt("Enter b : "); let gcd = 1; let lcm = 1; for (let i = 0; i <= a && i <= b; i++) { if (a % i == 0 && b % i == 0) { gcd = i; } } lcm = (a * b) / gcd; console.log("The LCM of two numbers", a, "and", b, "is :", lcm); Output :         Happy Coding:) Day 33 Of 100 Days Coding Challenge Thank you...

Day 32: GCD or HCF of two numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day32 of 100DaysCodingChallenge for  GCD or HCF of two numbers input  Numbers  taken by the user. Code :  let a = prompt("Enter a : "); let b = prompt("Enter b : "); //let g = new Array(); //let h = new Array(); let gcd = 1; for (let i = 0; i <= a && i <= b; i++) { if (a % i == 0 && b % i == 0) { gcd = i; } } console.log("The GCD or HCF of two numbers", a, "and", b, "is : ", gcd); Output :         Happy Coding:) Day 32 Of 100 Days Coding Challenge Thank you...

Day 31: Fibonacci Series N of N Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day31 of 100DaysCodingChallenge for  Fibonacci Series N Numbers input  Numbers  taken by the user. Code :  let n = prompt("Enter N : "); let f1 = 0; let f2 = 1; let f = f1 + f2; let fs = 0; console.log("Fibonacci Series upto a Certain number", n, "is : "); console.log(f1); console.log(f2); while (f <= n) { console.log(f); f1 = f2; f2 = f; f = f1 + f2; } Output :         Happy Coding:) Day 31 Of 100 Days Coding Challenge Thank you...

Day 30: Fibonacci Series of N Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day30 of 100DaysCodingChallenge for  Fibonacci Series of N Numbers input  Numbers  taken by the user. Code :  let n = prompt("Enter N : "); let f1 = 0; let f2 = 1; let f = f1 + f2; let fs = 0; console.log("Fibonacci Series upto", n+"th term is : "); console.log(f1); console.log(f2); for (let i = 3; i <= n; i++) { // console.log(f1); // console.log(f2); // console.log(f1, f2); console.log(f); f1 = f2; f2 = f; f = f1 + f2; } Output :         Happy Coding:) Day 30 Of 100 Days Coding Challenge Thank you... 

Day 29: Multiplication Table of N Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day29 of 100DaysCodingChallenge for  Multiplication Table of N Numbers input  Numbers  taken by the user. Code :  let n = prompt("Enter N : "); let range = prompt("Enter Range : "); console.log("The Multiplication Table of", n, "for a \ngiven Range", range, " is : "); for (let i = 1; i <= range; i++) { // console.log("i ", i); t = i * n; console.log(n + " * " + i + " = " + n * i); } // console.log(t); Output :         Happy Coding:) Day 29 Of 100 Days Coding Challenge Thank you...

Day 28: Multiplication Table of N Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day28 of 100DaysCodingChallenge for  Multiplication Table of N Numbers input  Numbers  taken by the user. Code :  let n = prompt("Enter N : "); let t; console.log("The Multiplication Table of ", n, " is : "); for (let i = 1; i <= 10; i++) { // console.log("i ", i); t = i * n; console.log(n + " * " + i + " = " + n * i); } // console.log(t); Output :         Happy Coding:) Day 28 Of 100 Days Coding Challenge Thank you...

Day 27: Factorial of N Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day27 of 100DaysCodingChallenge for  Factorial of N Numbers input  Numbers  taken by the user. Code :  let n = prompt("Enter N : "); let f = 1; for (let i = 1; i <= n; i++) { f = f * i; } console.log("The Factorial of ", n, "is ", f); Output :         Happy Coding:) Day 27 Of 100 Days Coding Challenge Thank you...

Day 26: Sum of N Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day26 of 100DaysCodingChallenge for  Sum of N Numbers input  Numbers  taken by the user. Code :  let n = prompt("Enter N : "); let sum = 0; // let sum; for (let i = 0; i <= n; i++) { sum = sum + i; // console.log(sum + i); // i++; } console.log("The Sum of first ", n, "numbers is ", sum); Output :         Happy Coding:) Day 26 Of 100 Days Coding Challenge Thank you...

Day 25: Student Result of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day25 of 100DaysCodingChallenge for  Student Result input  Marks  taken by the user. Code :  let marksObtained = prompt("Enter your obtained marks : "); if (marksObtained >= 40) { if (marksObtained >= 90) { console.log("You obtained grade A."); } else if (marksObtained >= 80) { console.log("You obtained grade B."); } else if (marksObtained >= 70) { console.log("You obtained grade C."); } else if (marksObtained >= 60) { console.log("You obtained grade D."); } else { console.log("You obtained grade E."); } } else { console.log("You are Failed this Examination."); } Output :       Happy Coding:) Day 25 Of 100 Days Coding Challenge Thank you...

Day 24: pass Or Fail of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day24 of 100DaysCodingChallenge for  pass Or Fail input  Marks  taken by the user. Code :  let marksObtained = prompt("Enter marksObtained : "); // let passingMarks = prompt("Enter passingMarks : "); let passingMarks = 40; if (marksObtained >= passingMarks ) { console.log("Yeah.! You are Passed this Examination."); } else { console.log("Oops.! You are not Passed this Examination."); } Output :       Happy Coding:) Day 24 Of 100 Days Coding Challenge Thank you...

Day 23: String Palindrome of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day23 of 100DaysCodingChallenge for  String Palindrome input  String   taken by the user. Code :  let a = prompt("Enter a : "); let b = a.split('').reverse().join(''); if (a == b) { console.log(a, "is a Palindrome String."); } else { console.log(a, "is not a Palindrome String."); } Output :       Happy Coding:) Day 23 Of 100 Days Coding Challenge Thank you...

Day 22: Boolean Number String of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day22 of 100DaysCodingChallenge for  Boolean Number String Data input taken by the user. Code :  let a = prompt("Enter a : "); if (a == 0 || a == 1) { console.log(a, "is a Boolean."); } else if (a > 1) { console.log(a, "is a Number."); } else { console.log(a, "is a String."); } Output :       Happy Coding:) Day 22 Of 100 Days Coding Challenge   Thank you...

Day 21: Quadratic Equation of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day21 of 100DaysCodingChallenge for  Quadratic Equation taken inputs by the user. Code :  let a = prompt("Enter a : "); let b = prompt("Enter b : "); let c = prompt("Enter c : "); let d = (b*b) - (4*a*c); if (d > 0) { console.log("The roots are real and different."); let root1 = (-b-Math.sqrt(d))/2*a; let root2 = (-b+Math.sqrt(d))/2*a; console.log("The real and different roots are : ", root1, root2); } else if (d == 0) { console.log("The roots are real and equal."); let root1 = root2 = -b/2*a; console.log("The real and equal roots are : ", root1, root2); } else { console.log("The roots are complex and different."); let realPart = -b/(2*a); let imaginaryPart = Math.sqrt(-d)/(2*a); console.log("root1 = ", realPart, "+", "i", imaginaryPart); console.

Day 20: Positive Number of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day20 of 100DaysCodingChallenge for  Positive Number taken input by the user. Code :  let y = prompt("Enter a Number : "); let a = parseInt(y); if (a > 0) { console.log(y, "Number is a Positive Number."); } else { console.log(y, "Number is not a Positive Number."); } Output :       Happy Coding:) Day 20 Of 100 Days Coding Challenge   Thank you...

Day 19: Leap Year of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day19 of 100DaysCodingChallenge for  Leap Year taken input by the user. Code :  let y = prompt("Enter the Year : "); let a = parseInt(y); if ((a % 4 == 0) || (a % 400 == 0) && (a % 100 != 0) ) { console.log(y, "Year is a Leap Year."); } else { console.log(y, "Year is not a Leap Year."); } Output :       Happy Coding:) Day 19 Of 100 Days Coding Challenge   Thank you...

Day 18: Largest Number of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day18 of 100DaysCodingChallenge for  Largest Number taken input by the user. Code :  let a = prompt("Enter Number a : "); let b = prompt("Enter Number b : "); let c = prompt("Enter Number c : "); if (a > b) { console.log(a, "Number is a Largest Number."); } else if (b > c) { console.log(b, "Number is a Largest Number."); } else { console.log(c, "Number is a Largest Number."); } Output :        Happy Coding:) Day 18 Of 100 Days Coding Challenge   Thank you...

Day 17: Vowel Consonant Characters of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day17 of 100DaysCodingChallenge for  Vowel Consonant Characters taken input by the user. Code :  let c = prompt("Enter a Character : "); if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') { console.log(c, "Character is a Vowel.!"); } else if (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U') { console.log(c, "Character is a Vowel.!"); } else { console.log(c, "Character is a Consonant.!"); } Output :        Happy Coding:) Day 17 Of 100 Days Coding Challenge   Thank you...

Day 16: Even Odd Number of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day16 of 100DaysCodingChallenge for  Even Odd Number taken input by the user. Code :  let a = prompt("Enter a Number : "); if (a % 2 == 0) { console.log(a, "Number is Even."); } else { console.log(a, "Number is Odd."); } Output :      Happy Coding:) Day 16 Of 100 Days Coding Challenge   Thank you...

Day 15: Multiplication of two Decimal Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day15 of 100DaysCodingChallenge for  Multiplication of two Decimal Numbers taken input by the user. Code :  let a = prompt("Enter a : "); let b = prompt("Enter b : "); let c = a * b; console.log("Multiplication of two Decimal Numbers "); console.log("a * b = ", c); Output :      Happy Coding:) Day 15 Of 100 Days Coding Challenge   Thank you...  

Day 14: ASCII Value of a character of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day14 of 100DaysCodingChallenge for  ASCII Value of a character taken input by the user. Code :  let a = prompt("Enter a character: "); // convert into ASCII value let b = a.charCodeAt(0); console.log(`The ASCII value is: ${b}`); Output :      Happy Coding:) Day 14 Of 100 Days Coding Challenge   Thank you...  

Day 13: Swap two Integer Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day13 of 100DaysCodingChallenge for  Swap two Integer Numbers taken input by the user. Code :  let a = prompt("Enter a : "); let b = prompt("Enter b : "); console.log("Before Swaping Numbers "); console.log("a is : ", a); console.log("b is : ", b); let temp = a; a = b; b = temp; console.log("After Swapping Numbers "); console.log("a is : ", a); console.log("b is : ", b); Output :      Happy Coding:) Day 13 Of 100 Days Coding Challenge   Thank you...

Day 12: compute Quotient Remainder Integer Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day12 of 100DaysCodingChallenge for  compute Quotient Remainder Integer Numbers taken input by the user. Code :  let a = prompt("Enter Dividend : "); let b = prompt("Enter Divisor : "); let c = a / b; console.log("Quotient is : ", c); let q = a % b; console.log("Remainder is : ", q); Output :      Happy Coding:) Day 12 Of 100 Days Coding Challenge   Thank you...

Day 11: Modulo of two Integer Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day11 of 100DaysCodingChallenge for  Modulo of two Integer Numbers taken input by the user. Code :  let a = prompt("Enter a : "); let b = prompt("Enter b : "); let c = a % b; console.log("a % b is : ", c); Output :      Happy Coding:) Day 11 Of 100 Days Coding Challenge   Thank you...

Day 10: Cube Root of Integer Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day10 of 100DaysCodingChallenge for  Cube Root of Integer Numbers taken input by the user. Code :  let a = prompt("Enter a : "); let b = parseInt(a); let x = Math.cbrt(b); console.log("cube root of a :", x); Output :     Happy Coding:) Day 10 Of 100 Days Coding Challenge   Thank you...

Day 9: Cube of Integer Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day9 of 100DaysCodingChallenge for  Cube of Integer Numbers taken input by the user. Code :  let a = prompt("Enter a : "); let x = parseInt(a); let c = x * x * x; console.log("a cube of an integer is : ", c);  Output :    Happy Coding:) Day 9 Of 100 Days Coding Challenge   Thank you...

Day 8: Square Root Integer Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day8 of 100DaysCodingChallenge for  Square Root Integer Numbers taken input by the user. Code :  let a = prompt("Enter a : "); let x = parseInt(a); let c = Math.sqrt(x); console.log("square root of a is : ", c);  Output :    Happy Coding:) Day 8 Of 100 Days Coding Challenge   Thank you...

Day 7: Square or Power Integer Numbers of 100DaysCodingChallenge

Image
 Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day7 of 100DaysCodingChallenge for  Square or Power Integer Numbers taken input by the user. Code :  let a = prompt("Enter a : "); let x = parseInt(a); let c = x ** x; console.log("a ** a = ", c);  Output :    Happy Coding:) Day 6 Of 100 Days Coding Challenge   Thank you...

Day 6: Division of two Integer Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day6 of 100DaysCodingChallenge for  Division of two Integer Numbers taken input by the user. Code :  let a = prompt("Enter a : "); let b = prompt("Enter b : "); let x = parseInt(a); let y = parseInt(b); let c = x / y; console.log("a / b = ", c);  Output :    Day 6 Of 100 Days Coding Challenge   Thank you..

Day 5: Multiply two Integer Numbers of 100DaysCodingChallenge

Image
Hello all,  I have started the 100 days of coding challenge to improve my programming skills.. Today is the Day5 of 100DaysCodingChallenge for  Multiply Day 5 Of 100 Days Coding Challenge   Thank you.. two Integer Numbers taken input by the user. Code :  let a = prompt("Enter a : "); let b = prompt("Enter b : "); let x = parseInt(a); let y = parseInt(b); let c = x * y; console.log("a * b = ", c);  Output :