CSE106 - Fundamentals of Web Design
Assignment 4
Details of the Student:
- Name: Thashan Anil Dasashish
- Enrollment ID: SAU/FET/BTECH(CSE)/2025/213
- Section: D
- Branch: B. Tech. CSE - Semester 2
- Email: thashan.dasashish2025@students.sau.ac.in
Index
Question 1:
Digit Gatekeeper
Given three integers L, R, and K, count how many integers x satisfy all of the following:
- L ≤ x ≤ R
- x is divisible by K
- The sum of digits of x is a prime number
- x does not contain the digit 0
Input Format: Use prompt() to take L, R, and K.
Output Format: Display the count using alert().
Constraints: 1 ≤ L ≤ R ≤ 10^6, 2 ≤ K ≤ 9
Solution:
Press the button to execute JS solution of the question.