Login
|
Signup
langref.org
-
php
and
csharp
add..
all
clojure
cpp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
python
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Structure
Conditionals
Perform an action if a condition is true (IF .. THEN)
Given a variable name, if the value is
"Bob"
, display the string
"Hello, Bob!"
. Perform no action if the name is not equal.
php
if($name == "Bob") {
echo "Hello, Bob!";
}
<?php
if($name == "Bob") {
echo "Hello, Bob!";
}
?>
csharp
if (name == "Bob") Console.WriteLine("Hello, {0}!", name);
if (name == "Bob") Console.WriteLine("Hello, {0}!", name);
Submit a new solution for
php
or
csharp
There are 20 other solutions in
additional
languages (
clojure
,
cpp
,
erlang
,
fantom
...)