UGC NET Computer Science C Programming Language Previous Year Questions (PYQs) – Page 1 of 4

UGC NET Computer Science C Programming Language Previous Year Questions (PYQs) – Page 1 of 4

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations
Reset
Showing 38 questions
logo
🎓 UGC NET Computer Science📅 Year: 2023📚 Computer🏷 C Programming Language

What is x in the following program?
#include <stdio.h>

int main()
{
    typedef (*(*arrfptr[3])())[10];

    arrfptr x;

    return 0;
}

1
2
3
4

logo
🎓 UGC NET Computer Science📅 Year: 2023📚 Computer🏷 C Programming Language

What is the output of following code?

main()
{
static float a[] = {13.24, 1.5, 4.5, 5.4, 3.5}

float *j, *k;

j = a;

k = a + 4

j = j * 2;

k = k/2;

printf("% f% f", *j, *k);

}

1
2
3
4

logo
🎓 UGC NET Computer Science📅 Year: 2019📚 Computer🏷 C Programming Language

Consider the following pseudo-code fragment in which an invariant for the loop is $m \times x^k=p^n$ and $k\ge 0$.

Pre-conditions: $p\ge 1$ and $n\ge 0$

Assume that overflow never occurs.

int x = p;
int k = n;
int m = 1;

while (k != 0) {
if (k is odd) then m = m * x;
x = x * x;
k = floor(k / 2);
}

Which of the following must be true at the end of the while loop?


1
2
3
4

logo
🎓 UGC NET Computer Science📅 Year: 2019📚 Computer🏷 C Programming Language

Consider the following C-code fragment running on a $32$-bit x86 machine:

typedef struct {
union {
unsigned char a;
unsigned short b;
} U;
unsigned char c;
} S;

S B[10];
S *p = address of B[4];
S *q = address of B[5];

p->U.b = 0x1234;

If $M$ is the value of $q-p$ and $N$ is the value of address of $(p->c)$ minus address of $p$, then $(M,N)$ is:


1
2
3
4

logo
🎓 UGC NET Computer Science📅 Year: 2022📚 Computer🏷 C Programming Language

The condition $num\ !=\ 65$ cannot be replaced by-

1
2
3
4

logo
🎓 UGC NET Computer Science📅 Year: 2022📚 Computer🏷 C Programming Language

Pointers cannot be used to-

1
2
3
4

logo
🎓 UGC NET Computer Science📅 Year: 2019📚 Computer🏷 C Programming Language

Consider the following C++ function $f()$:

unsigned int f(unsigned int n) {
unsigned int b = 0;
while (n) {
b = b + (n bitwise AND 1);
n = n shifted right by 1;
}
return b;
}

The function $f()$ returns the integer that represents the $P$ in the binary representation of positive integer $n$, where $P$ is:


1
2
3
4

logo
🎓 UGC NET Computer Science📅 Year: 2024📚 Computer🏷 C Programming Language

The output of the following C++ Program is:
#include <stdio.h>
int main(void)
{
    int x, *p;
    x = 30;
    p = x;
    printf("%d", *p);
    return 0;
}

1
2
3
4

logo
🎓 UGC NET Computer Science📅 Year: 2022📚 Computer🏷 C Programming Language

Given

int arr[3][4][2] =
{
  {{2,4},{7,8},{3,4},{5,6}},
  {{7,6},{3,4},{5,3},{2,3}},
  {{8,9},{7,2},{3,4},{5,1}}
};

Which one of the following can be used to refer to element 1 in the above 3-d array?


1
2
3
4

logo
🎓 UGC NET Computer Science📅 Year: 2019📚 Computer🏷 C Programming Language

What is the output of following C program?
#include <stdio.h>

main()
{
    int i, j, x = 0;

    for (i = 0; i < 5; ++i)
        for (j = 0; j < i; ++j)
        {
            x += (i + j - 1);
            break;
        }

    printf("%d", x);
}

1
2
3
4

UGC NET Computer Science


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

UGC NET Computer Science


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...