public class Main {
public static void main(String[] args) {
int time = 20;
if (time < 18) {
System.out.println("Good day.");
} else {
System.out.println("Good evening.");
}
}
}
a = 200
b = 33
if a >= b:
print("A")
else:
print("B")
#include <stdio.h>
int main() {
int time = 20;
(time < 18) ? printf("Good day.") : printf("Good evening.");
return 0;
}
public class Main {
public static void main(String[] args) {
int time = 20;
String result;
result = (time < 18) ? "Good day." : "Good evening.";
System.out.println(result);
}
}
a = 200
b = 33
print("A") if a >= b else print("B")
<?php
$a = 13;
if ($a > 10) {
echo "Above 10";
if ($a > 20) {
echo " and also above 20";
} else {
echo " but not above 20";
}
}
?>
#include<stdio.h>
int main()
{
int num=1;
if(num<10)
{
if(num==1)
{
printf("The value is:%d\n",num);
}
else
{
printf("The value is greater than 1");
}
}
else
{
printf("The value is greater than 10");
}
return 0;
}
class Test {
public static void main(String args[]){
int x = 30;
int y = 10;
if( x == 30){
if( y == 10){
System.out.print("X = 30 and Y = 10");
}
}
}
}
x = 41
if x > 10:
print("Above ten,")
if x > 20:
print("and also above 20!")
else:
print("but not above 20.")