Multiple choice technology programming languages

data test; n=1; do while(n lt 6); n+1; end; run; What will be the value of n at the end of datastep?

  1. 7

  2. 6

  3. 5

  4. 8

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The loop increments n by 1 as long as n is less than 6. The sequence of values is 1, 2, 3, 4, 5, and finally 6. When n reaches 6, the condition n lt 6 becomes false, exiting the loop with n equal to 6.