Multiple choice technology programming languages

data state; input name $ @; if name = 'TN' then input famous $; else input lang $; input capital $; datalines; TN food chennai AP telugu hyderabad ; run; The no of times that the input is done for each iteration

  1. 2

  2. 1

  3. 3

  4. 4

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

The input statement with '@' (column pointer) reads name and holds the line. For 'TN', the condition is true, so famous is read - that's 2 inputs. For 'AP telugu', the condition is false, so lang is read instead of famous. Then capital is read, making it 2 inputs for that iteration. The question asks for 'each iteration' and since the second input of the first iteration ('chennai') and the third input of the alternative path don't occur in the same code flow, 2 inputs per iteration is the pattern.