<script> var x=15; var y=16; var sum=x+y; document.writeln("Sum ="+sum); </script>
For more information, visit the following link:
In the above example name and age are two variable and further we have assigned some value to it. Always remember that the variable name must be written in small letters. document.write (); is used to print the value of variable.