Java script basic programming exercises

java script basic programming exercises

java script basic programming exercises

Java script basic programming exercises

We have gathered a variety of JavaScript exercises (with answers) for each JavaScript Chapter.

Try to solve an exercise by editing some code, or show the answer to see what you’ve done wrong.

1. Write a Java Script program to enter length and breadth of a rectangle and find its perimeter.

				
					 <script>
        let l,b,p;
        l=parseInt(prompt("Enter Length"));
         b=parseInt(prompt("Enter Breadth"));
         p=2*(l+b);
         alert(p)
         </script>
				
			
Spread the love