Javascript Progamming Foundation Logic Development

  1. if else, switch case and Loops

      use if...else statements to solve the following problems
    1. Write a program to check a number is divisible by 7 or not.
    2. Write a program to check a number is factor of 84 or not.
    3. Write a program to check a number is factor of 96 or not.
    4. and if the given number is more Than 96 program should say ‘not a valid input’
    5. Write a program to check a number is multiple of 3 or not.
    6. Write a program to check a number is positive or not.
    7. Write a program to check a number is having 4 at units place (984).
    8. Write a program to check a number is 3 digited number or not.
    9. Write a program to print even or odd for a given number
    10. Write a program to print the greatest number in given two numbers
    11. Write a program to print the least number in given two numbers
    12. Write a program to print the given two numbers in ascending order
    13. Write a program to print the given two numbers in descending order
    14. Write a program to print the greatest number in given three numbers
    15. Write a program to print the least number in given three numbers
    16. Write a program to print the given three numbers in ascending order
    17. Write a program to print the given three numbers in descending order
    18. Write a program to take marks of three subjects and print the grade of student
    19. Character Is Vowel or Consonant
    20. A Character Is an Alphabet or Not
    21. Uppercase, Lowercase, Special Character, or Digit
    22. Leap Year
    23. The Date Is Correct or Not
    24. Voting Eligibility Checker
    25. Check whether a number is negative, positive or zero.
    26. Check whether a number is divisible by 5 and 11 or not.
    27. Input any alphabet and check whether it is vowel or consonant.
    28. Input any character and check whether it is the alphabet, digit or special character.
    29. Check whether a character is an uppercase or lowercase alphabet.
    30. Input week number and print weekday.
    31. Input month number and print number of days in that month.
    32. Count the total number of notes in a given amount.
    33. Input angles of a triangle and check whether the triangle is valid or not.
    34. Check whether the triangle is an equilateral, isosceles or scalene triangle.
    35. Use Loops to get the output for the following programming questions iteration
    36. Write a program to print 1 to 10 numbers using a while loop
    37. Write a program to print 10 to 1 numbers using a while loop
    38. Write a program to print 5 to 15 numbers using a while loop
    39. Write a program to print 15 to 10 numbers using a while loop
    40. Write a program to print 1 to 10 even numbers using a while loop
    41. Write a program to print 1 to 10 odd numbers using a while loop
    42. Write a program to print first ten multiples of 4 using a while loop (multiples of 4 are 4,8,12,16,20,.....)
    43. Write a program to print multiplication table of 6 using while loop
    44. Print the squares of all numbers from 1 to 10.
    45. Print the cubes of all numbers from 1 to 10.
    46. Write a program to print factors of 24 using while loop (factors of 24 are 1,2,3,4,6,8,12,24)
    47. Write a program to print 1 to 10 numbers using a for loop
    48. Write a program to print 10 to 1 numbers using a for loop
    49. Write a program to print all numbers from 1 to a given number
    50. Write a program to print 1 to 10 even numbers using a for loop
    51. Write a program to print 1 to 10 odd numbers using a for loop
    52. Write a program to print first 10 multiples of 3 using a for loop
    53. Write a program to print multiplication table of 6 using a for loop
    54. Write a program to print all the factors of a given number
    55. a program to read 5 numbers and print the maximum and minimum number
    56. a program to read 5 numbers and print only the even numbers
    57. Print all the digits of a given number
    58. Write a program to print only even digits of a given number The output should be 4,2,6 Ex. Let us take 154256
    59. Write a program to print only odd digits of a given number Ex. Let us take 1542763 The output should be 1,5,7,3
    60. Write a program to print the number at 10’s place
    61. Write a program to print the number at 100’s place
    62. Write a program to print the number at 1000’s place
    63. Write a program to print the number at 10000’s place
    64. Write a program to find the LCM of given two numbers
    65. Write a program to convert an octal number to a decimal
    66. Accumulation
    67. Write a program to print the sum of 1 to 10 ( initialisation of sum variable with 0 )
    68. Write a program to print the average of 1 to 10
    69. Write a program to print the sum of the numbers between the given two numbers
    70. Write a program to print the sum of even numbers between the given two numbers
    71. Write a program to print the sum of odd numbers between the given two numbers
    72. Write a program to print the product of the numbers between 1 to 10 ( initialisation of product variable with 1 )
    73. Write a program to find the product of all odd numbers between 1 and 10.
    74. Write a program to print the nth power of a given number. n can be any positive number. (n=3 r =4 then answer must be 3*3*3*3 )
    75. Write a program to print factorial of a given number
    76. Write a program to print the nCr of given ‘n’ and ‘r’
    77. Write a program to print the number of factors of 24 using while loop (number of factors for 24 is 8)
    78. Write a program to print the count of factors of a given number using for loop
    79. Write a program to check a given number is a prime number or not
    80. a program to read 5 numbers and print the sum of all entered numbers
    81. a program to read 5 numbers and print average of n numbers
    82. print Number of Digits in given number.
    83. Write a program to count the number of ‘1’s in a given number.
    84. Write a program to eliminate all 0’s from a given number.
    85. Write a program to print all the digits that are less than 5 in a given number.
    86. Print the greatest digit of a given number(n=1237456 then greatest digit is 7)
    87. sum of all digits of a given number Ex: let us take 19345 is the given number The output should be 22 (1+9+3+4+5)=22
    88. a program to print reverse of digits of a number
    89. print the binary value of 8.
    90. Write a program to convert a binary number into a decimal number
    91. Write a program to check a given number is palindrome number or not
    92. Write a program to check a given number is armstrong number or not Ex:153 is an armstrong number
    93. Write a program to print the fibonacci number series up to a given number Expected output:0 1 1 2 3 5 8 13
    94. Print A Calendar Taking Input From User Using Loop
    95. Switch-case
    96. Temperature Conversion Celsius To Fahrenheit And Vice Versa
    97. Calculator
    98. Find A Grade Of Given Marks or (Find a Grade of Given Marks Using Switch Case)
    99. Find Radius, Circumference and Volume of Cylinder
    100. Remove All Vowels From A String
    101. Print day of week name using switch case.
    102. Print total number of days in a month using switch case.
    103. Check whether an alphabet is a vowel or consonant using a switch case.
    104. Find the maximum between two numbers using the switch case.
    105. Check whether a number is even or odd using a switch case.
    106. Check whether a number is positive, negative or zero using a switch case.
    107. Find roots of a quadratic equation using switch case.
    108. Create a Simple Calculator using a switch case.
    Advanced and nested loops