for loop

Programming construct

An iteration or loop in a computer program is a set of statements that is executed repeatedly. C provides three iteration constructs:  While Do…while ForSyntax on while statement:- initialization; while(condition) { statement or body of the loop; increment/decrements; } Syntax on do..while statement:- initialization; do { statement or body of the loop; increment/decrements; }while(condition); Syntax […]

Share

Programming construct Read More »

Javascript loop programs

1. Print 1-10 numbers using FOR loop program <html> <head> <title> Javascript looping program </title> </head> <body> <script language=”javascript”> var i document.write(“<h1>”+”FOR Looping program” +”</h1>”) for(i=1; i<=10; i++) { document.write(i+”<br>”) } </script> </body> </html> 2. WHILE Loop using Javascript <html> <head> <title> Javascript while loop program </title> </head> <body> <script language=”javascript”> var i=1 document.write(“<h1>”+”WHILE Loop

Share

Javascript loop programs Read More »

Share
Scroll to Top