Ticker

6/recent/ticker-posts

Javascript program to find big of two number

 



Problem:- Javascript program to find big of two number.

  • open Notepad as editor.
  • Write HTML and Javascript code.
  • Save file filename.html.
  • Right click on file and open file with browser.
  • Browser show output according to the code.

HTML code with Javascript


Output






In this Javascript program promptbox is used to get the input value at runtime. Decision making statement is used to find big between two number if condtion is true then number1 is big else number2 is big. if-else decision making statement is used to take decision between two statement. document.writeln function is used to print the message. Here big value is print using document.writeln function. Use script tag to add javascript code with html.parseInt function is used to convert string value into integer  beacause  javascript is loosly type language.











Post a Comment

0 Comments