Exercises

LOGICAL QUESTIONS

  • Write a program to check whether a given number is even or odd.
    Input: 34
    Output: Even
  • Write a program to check whether a given number is prime or not.
    Input: 3
    Output: Prime
  • Write a program to calculate factorial of a number.
    Input: 5
    Output: 120
  • Write a program to calculate factorial using recursion.
    Input: 5
    Output: 120
  • Write a program to print fibnocci series till nth place.
    Input: 8
    Output: 0 1 1 2 3 5 8 13 ...
  • Write a program to calcuate power without using power function or multiplication operator.
    Input: 3, 4 (3 to the power 4)
    Output: 81
  • Write a program to print following pattern:
    *
    * *
    * * *
    * * * *
    * * * * *
    
  • Write a program to print following pattern:
        *
       * *
      * * *
     * * * *
    * * * * *
    
  • Write a program to create an array of 10 elements and then shuffle it so that elements get arranged in random order. Don't use any pre-defined function.
    Input: 0 1 2 3 4 5 6 7 8 9
    Output: 4 2 5 6 8 1 3 9 7 0 (It could be any random order)

HTML/CSS QUESTIONS

  • Create an empty div element making sure that its width and height should be equal to the size of your viewport (browsers height). Note: It should change with the size of a browser.
  • Create a webpage with a div having a background image. Image should have some opacity(translucent) but the content should be clear and fully opaque.

JAVASCRIPT/JQUERY QUESTIONS

  • Create 3 divs. On hovering-in on a specific div its size should increase. And on hovering-out its size should come to normal. Make sure it should work on each div individually. Hovering a div should only change that specific div's size.