Aspire Faculty ID #18806 · Topic: UGC NET Computer Science Sep 2022 (Paper II) · Just now
UGC NET Computer Science Sep 2022 (Paper II)

Of the following, which is NOT a logical error?

Solution

A logical error means the program runs, but it gives wrong output because the logic is incorrect.

Now check each option.

Option (a):

Using $'='$ instead of $'===' $ for comparison is a logical error.

Because $'='$ is used for assignment, while $'===' $ is used for strict comparison.

So, this may give wrong result.

Option (b):

Divide by zero is generally considered a run-time error.

The program may stop during execution.

Option (c):

Failing to initialize counter and total variables before loop execution is a logical error.

Because the program may use garbage or incorrect values and produce wrong output.

Option (d):

Using commas instead of required semicolons in a for loop header is a syntax error.

The program will not compile or run properly.

Since the question asks which is NOT a logical error, the best answer is syntax error.

Previous 10 Questions — UGC NET Computer Science Sep 2022 (Paper II)

Nearest first
1
Given below are two statements: one is labelled as Assertion (A) and the other is labelled as Reason (R):Assertion (A):…
Topic: UGC NET Computer Science Sep 2022 (Paper II)
2
A good software requirement specification does NOT have the characteristic
Topic: UGC NET Computer Science Sep 2022 (Paper II)
3
Consider the following in Boolean Algebra$X:a\lor(b\land(a\lor c))=(a\lor b)\land(a\lor c)$$Y:a\land(b\lor(a\land c))=(…
Topic: UGC NET Computer Science Sep 2022 (Paper II)
4
Consider the following statements about Context Free Language (CFL):Statement I: CFL is closed under homomorphism.State…
Topic: UGC NET Computer Science Sep 2022 (Paper II)
5
Consider the following statements:Statement I: LALR parser is more powerful than canonical LR Parser.Statement II: SLR …
Topic: UGC NET Computer Science Sep 2022 (Paper II)
6
A top down approach to programming calls for:Statement I: Working from the general to the specific.Statement II: Postpo…
Topic: UGC NET Computer Science Sep 2022 (Paper II)
7
Consider the following statements:Statement I: Composite attributes cannot be divided into smaller subparts.Statement I…
Topic: UGC NET Computer Science Sep 2022 (Paper II)
8
Consider the following statements:Statement I: Conservative 2 PL is a deadlock-free protocol.Statement II: Thomas's wri…
Topic: UGC NET Computer Science Sep 2022 (Paper II)
9
Consider the following statements of approximation algorithm:Statement I: Vertex-cover is a polynomial time 2-approxima…
Topic: UGC NET Computer Science Sep 2022 (Paper II)
10
Consider the following:List IList II(A) Stack algorithm(I) Deadlock(B) Elevator algorithm(II) Disk scheduling(C) Priori…
Topic: UGC NET Computer Science Sep 2022 (Paper II)

Next 10 Questions — UGC NET Computer Science Sep 2022 (Paper II)

Ascending by ID
Ask Your Question or Put Your Review.

loading...