Question
Consider the following pseudo-code: ``` function calculate(arr): sum = 0 for i from 0 to length(arr) - 1: if arr[i] % 2 == 0: sum = sum + arr[i] else: sum = sum - arr[i] return sum my_array = [1, 2, 3, 4, 5] result = calculate(my_array) print(result) ``` What will be the output of this code?
More IT DBMS Questions
- ACID properties in DBMS ensure:
- Which normal form eliminates transitive dependency?
- Wait-Die and Wound-Wait are strategies for:
- Transaction T1 reads a row twice within the same transaction. Between the two reads, T2 commits an update to that row, and T1's second read returns the new...
- In a relational database, what is a foreign key?
- Which of the following is true about ACID properties in DBMS?
- Given a binary tree, a "zigzag" level order traversal prints the nodes level by level, but alternating the order of nodes from left-to-right and right-to-l...
- Which ACID property of a database transaction ensures that a transaction is executed either completely or not at all, with no partial updates left in the d...
- In a relational database, which relationship allows multiple records in one table to be associated with multiple records in another table?
- A table Orders(order_id, customer_id, order_date, amount) needs a query that returns each order alongside a running cumulative total of that customer's ord...
Hey! Ask a query
Please enter email id
The email must be a valid email address.
Please enter Mobile Number
Please enter valid Mobile Number
Please enter your Doubt
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
- 200 Questions with Detailed Solutions
- Section-wise Coverage (GA, English, Quant & Reasoning)