I wanted to write below code with For loop having multiple conditions but it didn\'t work. Please point the mistake I made.