Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a PHP script to print all even numbers between 1 and 20 using a for loop.

Easy

Problem Statement

Write a PHP script to print all even numbers between 1 and 20 using a for loop.

Sample Input

No input required.

Sample Output

2 4 6 8 10 12 14 16 18 20 

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
<?php // Write code to here ?>
Log in or sign up to run or submit your code.Log inSign up
Input
No input required.
Expected Output
2 4 6 8 10 12 14 16 18 20