Aspire Faculty ID #17510 · Topic: UGC NET Computer Science August 2024 (Paper II) · Just now
UGC NET Computer Science August 2024 (Paper II)

Consider the following C program :
#include<stdio.h>
int main()
{
    int x[]={2,4,6,8,10};
    int a, b=0, *y = x + 4;

    for(a=0; a<5; a++)
    {
        b = b + (*y - a) - *(y - a);
    }

    printf("%d\n", b);
    return 0;
}
What will be the output of the above C program ?

Solution

Pointer

$y = x + 4$

So

$*y = 10$

Loop runs $a=0$ to $4$

Expression:

$b = b + (*y - a) - *(y-a)$

Compute:

$a=0$ → $(10-0) - 10 = 0$
$a=1$ → $(10-1) - 8 = 1$
$a=2$ → $(10-2) - 6 = 2$
$a=3$ → $(10-3) - 4 = 3$
$a=4$ → $(10-4) - 2 = 4$

Sum

$b = 0+1+2+3+4 = 10$

Previous 10 Questions — UGC NET Computer Science August 2024 (Paper II)

Nearest first
1
Consider the following statements regarding combinational and sequential circuits. (A) Output of combinational circuits…
Topic: UGC NET Computer Science August 2024 (Paper II)
2
In a token ring network the transmission speed is $10^7$ bps and the propagation speed is $200 , m/\mu s$. The 1-bit de…
Topic: UGC NET Computer Science August 2024 (Paper II)
3
Match List - I with List - II.&nbsp;List - I&nbsp;List - II&nbsp;(A) The activation function&nbsp;(I) is called the del…
Topic: UGC NET Computer Science August 2024 (Paper II)
4
Arrange the following steps in the correct order to solve the Knapsack problem using Dynamic Programming. (A) Define th…
Topic: UGC NET Computer Science August 2024 (Paper II)
5
Match List-I with List-II.&nbsp;List-I (computing systems)List-II (working/output)&nbsp;&nbsp;(A) Half Adder&nbsp;(I) H…
Topic: UGC NET Computer Science August 2024 (Paper II)
6
Which of the following C++ statements correctly declares an abstract class ?
Topic: UGC NET Computer Science August 2024 (Paper II)
7
Arrange the following steps in a proper sequence for the process of training a neural network.(A) Weight initialization…
Topic: UGC NET Computer Science August 2024 (Paper II)
8
Arrange the following steps in proper sequence involved in a Genetic Algorithm :(A) Selection(B) Initialization(C) Cros…
Topic: UGC NET Computer Science August 2024 (Paper II)
9
Which of the following statements about pointers in C are TRUE.(A) Pointers can be used to access array elements(B) Poi…
Topic: UGC NET Computer Science August 2024 (Paper II)
10
Consider the Grammar :$S \rightarrow A$$A \rightarrow S B S \mid id$$B \rightarrow B, A \mid A$If $I_0 = CLOSURE({[S' \…
Topic: UGC NET Computer Science August 2024 (Paper II)

Next 10 Questions — UGC NET Computer Science August 2024 (Paper II)

Ascending by ID
1
Translate $\forall x \exists y (x &lt; y)$ in English. Consider domain as a real number for both the variables.
Topic: UGC NET Computer Science August 2024 (Paper II)
2
For all real numbers $x$, there exists a real number $y$ such that $x$ is less than $y$.(A) $L_1 = { w \in {0,1}^* \mid…
Topic: UGC NET Computer Science August 2024 (Paper II)
3
Consider the Grammar : $T \rightarrow Qx$ $Q \rightarrow RS$ $R \rightarrow y \mid \varepsilon$ $S \rightarrow z \mid \…
Topic: UGC NET Computer Science August 2024 (Paper II)
4
Two computers A and B are configured as follows :A has IP address 203.197.2.53 and subnet mask 255.255.128.0B has IP ad…
Topic: UGC NET Computer Science August 2024 (Paper II)
5
Match List - I with List - II.&nbsp;List - I (IP Address)List - II (Class) &nbsp;&nbsp;(A) 10.20.30.40&nbsp;(I) Class E…
Topic: UGC NET Computer Science August 2024 (Paper II)
6
What will be the output of the following C code?#include&lt;stdio.h&gt;void main(){&nbsp; &nbsp; int arr[5] = {10, 20, …
Topic: UGC NET Computer Science August 2024 (Paper II)
7
What is SQL primarily used for in the context of relational databases?
Topic: UGC NET Computer Science August 2024 (Paper II)
8
Given a project that uses the COCOMO model with an estimated effort of 2000 person-months and a productivity rate of 5 …
Topic: UGC NET Computer Science August 2024 (Paper II)
9
Match List - I with List - II.&nbsp;List - I (software design principles)&nbsp;List - II (Definitions)&nbsp;(A) Cohesio…
Topic: UGC NET Computer Science August 2024 (Paper II)
10
Consider the transactions $T_1, T_2, T_3$ and the schedules $S_1$ and $S_2$ given below. $T_1 : r_1(x); r_1(z); w_1(z)$…
Topic: UGC NET Computer Science August 2024 (Paper II)
Ask Your Question or Put Your Review.

loading...