Page 125 - PortGPT_V2.1_C8_Flipbook
P. 125
5. What is looping?
6. Write the syntax to the for loop.
7. Name 2 event handlers.
8. What is a function?
D. Long answer type questions.
1. Draw the flowchart for nested if statement.
2. Write a JavaScript program to convert centimeters to inches. (Hint: 1 inch = 2.54 cms)
3. Write the syntax of the while loop and give an example.
4. Distinguish between continue and break statements.
5. What is event handling?
6. What is the difference between while and do-while statements?
7. How does Event handling take place in JavaScript?
E. Write a JavaScript program to calculate the area of a circle.
F. Write a Program in JavaScript to determine whether a given number is prime or not.
G. Factorial of a number means that the given number is multiplied by all the numbers preceding
up to that number. For eg,
5! = 5 x 4 x 3 x 2 x 1 = 120
Write a program in JavaScript to determine the factorial of a given number.
Test Sheet 2 123

