[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Technical Aptitude :: Control Instructions - Discussion

Home > Technical Aptitude > Control Instructions > MCQs Questions Discussion

80 / 33

Choose the correct option.

Vijay wants to print the following pattern on the screen: 1
1 2
1 2 3

He writes the following program:

integer i = 1 // statement 1
while ( i <= 3 )
{
int j // Statement 2
while ( j <= i ) // Statement 3
{
print j
print blank space
j = j + 1 // Statement 4
}
print end-of-line \takes the cursor to the next line i = i + 1
}

Will this program function correctly? If not which one statement will you modify to make the program function correctly?

AStatement 1

BStatement 2

CStatement 3

DStatement 4

EProgram does not have error.

Answer: Option (Login/Signup)

Show Explanation

Asked In :: TCS NQT TCS Ninja TCS Digital

Post Your Answer Here:     

Reply    
Rate This: +0 -0
    Report


Report Error

Please Login First Click Here