R_Code-11.r
Problem Statement
R_Code-11.r
Write a while loop that starts with a multiplier of 1. The loop should multiply the current multiplier by 4, assign it to a result variable, and print the result. The loop should exit if the result exceeds 100; otherwise, increment the multiplier by 1.
Source Code
r
# Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 20 Mar 2026
# Repo: https://github.com/notamitgamer/bsc
# License: MIT
# Write a while loop that starts with a multiplier of 1.
# The loop should multiply the current multiplier by 4,
# assign it to a result variable, and print the result.
# The loop should exit if the result exceeds 100; otherwise,
# increment the multiplier by 1.
num = 1
while(TRUE) {
result <- num * 4
print(result)
if (result > 100) {
break
}
num = num + 1
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
● Author - Amit Dutta · Updated - 20 Mar 2026