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

Programming Exercises

Create a PHP script to use a switch statement to print the name of the day based on a number (1 for Monday, 2 for Tuesday, etc.).

Easy

Problem Statement

Create a PHP script to use a switch statement to print the name of the day based on a number (1 for Monday, 2 for Tuesday, etc.).

Sample Input

A variable $day with a value between 1 and 7.

Sample Output

Monday

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
<?php // Write code here ?>
Log in or sign up to run or submit your code.Log inSign up
Input
A variable $day with a value between 1 and 7.
Expected Output
Monday