0% found this document useful (0 votes)
23 views1 page

JavaScript Loop & If-Else Interview Q&A

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views1 page

JavaScript Loop & If-Else Interview Q&A

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

JavaScript Loops & If-Else Interview Questions (20)

1. Difference between for, while, and do...while loops in JavaScript?

2. Write a program to print even numbers between 1 to 20.

3. Find the sum of numbers from 1 to N using loop.

4. Write a program to reverse a string using a loop.

5. Check whether a number is Prime or not.

6. Write a program to find factorial of a number.

7. What is the difference between for...in and for...of loop?

8. Write a program to count vowels in a string.

9. Write a program to check if a number is a palindrome.

10. Print a pattern using loops (*, **, ***, etc.).

11. Write a program to find the largest number in an array using a loop.

12. Write a program to check if a given year is a leap year.

13. Write a program to calculate the Fibonacci series up to N terms.

14. Write a program to find the minimum number in an array.

15. Write a program to print multiplication table of a given number.

16. Write a program to check whether a number is Armstrong or not.

17. Write a program to count digits in a number.

18. Write a program to check if a number is positive, negative, or zero.

19. Write a program to print factorial using while loop.

20. Write a program to print number pattern (1, 12, 123, …).

You might also like