if a > b then
if b > c then
output “a is the largest”
else
output “c is the largest”
else
if a > c then
output “b is the largest”
else
output “c is the largest”
if a > b:
if b > c:
print("a is the largest")
else:
print("c is the largest")
else:
if a > c:
print("b is the largest")
else:
print("c is the largest")
if (a > b) {
if (b > c) {
System.out.println("a is the largest");
} else {
System.out.println("c is the largest");
}
} else {
if (a > c) {
System.out.println("b is the largest");
} else {
System.out.println("c is the largest");
}
}
If a > b Then
If b > c Then
Console.WriteLine("a is the largest")
Else
Console.WriteLine("c is the largest")
End If
Else
If a > c Then
Console.WriteLine("b is the largest")
Else
Console.WriteLine("c is the largest")
End If
End If
Nested iteration involves a loop contained within another loop.
FOR i ← 1 TO 10
FOR j ← 1 TO 5
OUTPUT "i = ", i, " j = ", j
END FOR
END FOR
for i in range(1, 11):
for j in range(1, 6):
print("i = ", i, " j = ", j)
for (int i = 1; i <= 10; i++) {
for (int j = 1; j <= 5; j++) {
System.out.println("i = " + i + " j = " + j);
}
}
For i As Integer = 1 To 10
For j As Integer = 1 To 5
Console.WriteLine("i = " & i & " j = " & j)
Next j
Next i
92 docs|30 tests
|
|
Explore Courses for Year 11 exam
|