0% found this document useful (0 votes)
9 views

Assignment on javascript basic.docx

Fgiuggf

Uploaded by

kbalu8875
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)
9 views

Assignment on javascript basic.docx

Fgiuggf

Uploaded by

kbalu8875
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
You are on page 1/ 2

Assignment on javascript basic

1. Write a Javascript program to check whether a triangle is Equilateral,


Isosceles or Scalene.
Test Data :
50 50 60
Expected Output :
This is an isosceles triangle.
2. Write a Javascript program to find the largest of three numbers.
Test Data : 12 25 52
Expected Output :
1st Number = 12, 2nd Number = 25, 3rd Number = 52
The 3rd Number is the greatest among three
3. Write a Javasript program that implements a program to check if a given
number is a palindrome using a while loop.
4. Write a Javasript program to find and print the first 10 Fibonacci numbers
using a while loop.
5. Write a Javasript program that prompts the user to enter a positive integer.
Use a while loop to print the multiplication table for that number up to 10.
6. Write a Javasript program that calculates the sum of even and odd numbers
from 1 to 50 using do-while loops.
7. Write a Javasript program that calculates and prints the sum of prime
numbers up to a specified limit (e.g., 50) using a do-while loop.
8. Write a Javascript program that implements a program to count the number
of digits in a given integer using a do-while loop.
9. Write a Javascript program to display a pattern like a right angle triangle
with a number.

10.Write a program in Javascript to make such a pattern like a right angle


triangle with a number which will repeat a number in a row.

11.Write a program in C to make such a pattern like a right angle triangle with
the number increased by 1.The pattern like :

1
23
456
7 8 9 10
12.Write a program in Javascript to make such a pattern like a right angle
triangle with the number increased by 1.The pattern like :

1
22
333
4444
13.The pattern like :
1
1 2
1 23
1 234
14. Write a Javascript program to check whether a given number is a
'Perfect' number or not.
Test Data :
Input the number : 56
Expected Output :
The positive divisor : 1 2 4 7 8 14 28
The sum of the divisor is : 64
So, the number is not perfect.
15. Write a Javascript program to find the Armstrong number for a given
range of number.
Test Data :
Input starting number of range: 1
Input ending number of range : 1000
Expected Output :
Armstrong numbers in given range are: 1 153 370 371 407

You might also like