Skip to content

Interview Question Print Number & Linio, IT , Linianos

Notifications You must be signed in to change notification settings

KamalKant-Tech/Linianos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Linianos

Interview Question Print Number & Linio, IT , Linianos

Requirements

Write a program that prints all the numbers from 1 to 100. However, for multiples of 3, instead of the number, print "Linio". For multiples of 5 print "IT". For numbers which are multiples of both 3 and 5, print "Linianos".

But here's the catch: you can use only one if. No multiple branches, ternary operators or else.

Conver the following features in your program:

  • Maximum of 1 if
  • You can't use else, else if or ternary
  • Unit tests
  • Feel free to apply your SOLID knowledge

Prerequisite

  • php-cli or xampp/lamp
  • PHP 7.1, preferred 7.1.6

Usage

  1. Download or clone the repository
  2. Run challenge php script in project root:
    php Solution.php
+ Output: 1 2 Linio .... 98 Linio IT

Unit Test

  1. Run Below command
  phpunit SolutionUnitTest

About

Interview Question Print Number & Linio, IT , Linianos

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages