Answer:
Option B is the correct answer.
Explanation:
- In the above code, the loop will execute only one time because the loop condition is false and it is the Do-While loop and the property of the Do-while loop is to execute on a single time if the loop condition is false.
- Then the statement "x*=20;" will execute one and gives the result 200 for x variable because this statement means "x=x*20".
- SO the 200 is the answer for the X variable which is described above and it is stated from option B. Hence it is the correct option while the other is not because--
- Option A states that the value is 10 but the value is 200.
- Option C states that this is an infinite loop but the loop is executed one time.
- Option D states that the loop will not be executed but the loop is executed one time
Answer:
Given code output is "786".
Explanation:
Code:
list1 = [ 'cyber', 786 , 2.23, 'square', 70.2 ]#defining a list list1 that holds value in parameter
print (list1[1] )#use a print method that prints list index value
In the given code a list "list1" is declared that holds value in it and in the next step a print method is declared that prints the first index value of the list.
Answer:
The program is written using PYTHON SCRIPT below;
N=int(input(" Enter number of Rows you want:"))
M=[] # this for storing the matrix
for i in range(N):
l=list(map(int,input("Enter the "+str(i+1)+" Row :").split()))
M.append(l)
print("The 2D Matrix is:\n")
for i in range(N):
print(end="\t")
print(M[i])
W=[] # to store the first non zero elemnt index
T=[] # to store that value is positive or negative
L=len(M[0])
for i in range(N):
for j in range(L):
if (M[i][j]==0):
continue
else:
W.append(j) # If the value is non zero append that postion to position list(W)
if(M[i][j]>0): #For checking it is positive or negative
T.append(+1)
else:
T.append(-1)
break
print()
print("The first Non Zero element List [W] : ",end="")
print(W)
print("Positive or Negative List [T] : ",end="")
print(T)
Explanation:
In order for the program to determine a set of test cases it takes in input of 2D matrix in an N numbet of rows.
It goes ahead to program and find the column index of the first non-zero value for each row in the matrix A, and also determines if that non-zero value is positive or negative. The If - Else conditions are met accordingly in running the program.
Microsoft Expression Web 4 is
--
Component of Expression Studio
--
Design and Develop Web Pages using HTML5, CC3, ASP.Net, and more
--
Requires .Net Framework & Silverlight 4.0
--