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

Consider the following C code :

#include<stdio.h>


int temp = 0;


int fun(int x, int y)

{

    int z;

    temp++;


    if (y == 3)

        return (x*x*x);

    else

    {

        z = fun(x, y/3);

        return (z*z*z);

    }

}


int main()

{

    fun(4,81);

    printf("%d", temp);

}
What will be the output of the above code ?

Solution

Recursive calls divide $y$ by $3$ each time.

Call sequence:

$fun(4,81)$
$fun(4,27)$
$fun(4,9)$
$fun(4,3)$

Total calls = 4

Each call increments temp.

So

$temp = 4$

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

Nearest first
1
Given a project with an estimated effort of 1500 person-hours and a team of 5 people, how many days will it take to com…
Topic: UGC NET Computer Science August 2024 (Paper II)
2
Which of the following tasks could be attained using syntax trees in compiler design ? (A) Type Checking (B) Code Gener…
Topic: UGC NET Computer Science August 2024 (Paper II)
3
Which of the following best describes the structure of a relational database ?
Topic: UGC NET Computer Science August 2024 (Paper II)
4
Which of the following is correct way to declare a functional pointer in C ?
Topic: UGC NET Computer Science August 2024 (Paper II)
5
Match List - I with List - II.&nbsp;List - I (Queries)&nbsp;List - II (Probability)&nbsp;(A) A bag contains 6 white and…
Topic: UGC NET Computer Science August 2024 (Paper II)
6
Match List - I with List - II.&nbsp;List - I (Recurrence Relations)List - II (Complexity)&nbsp;&nbsp;(A) $T(n)=2T(n/2)+…
Topic: UGC NET Computer Science August 2024 (Paper II)
7
Arrange the following steps of Feature Driven Development (FDD) process in the correct sequence :(A) Develop an overall…
Topic: UGC NET Computer Science August 2024 (Paper II)
8
Which of the following statements are TRUE about Process Control Block (PCB) ?(A) The PCB contains information about th…
Topic: UGC NET Computer Science August 2024 (Paper II)
9
Match List - I with List - II.&nbsp;List - I (operating system concepts)List - II (characteristics)&nbsp;&nbsp;(A) Pagi…
Topic: UGC NET Computer Science August 2024 (Paper II)
10
Select the Sorting Algorithms that are stable.(A) Quick Sort(B) Bubble Sort(C) Insertion Sort(D) Merge Sort(E) Shell So…
Topic: UGC NET Computer Science August 2024 (Paper II)

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

Ascending by ID
1
Let $P$ be “It is hot day” and $q$ be “The temperature is $48^\circ C$”. Write in simple sentences the meaning of $\neg…
Topic: UGC NET Computer Science August 2024 (Paper II)
2
Let $L(x,y)$ be the statement “$x$ loves $y$” where the domain for both $x$ and $y$ consists of all people in the world…
Topic: UGC NET Computer Science August 2024 (Paper II)
3
Consider the following relations on ${1,2,3,4}$. Which of the following relations are reflexive ?(A) $R_1={(1,1),(1,2),…
Topic: UGC NET Computer Science August 2024 (Paper II)
4
Fifth normal form is concerned with :
Topic: UGC NET Computer Science August 2024 (Paper II)
5
A coin is tossed successively three times. Find the Probability $(P)$, Event $(E)$, Sample space $(S)$ of getting exact…
Topic: UGC NET Computer Science August 2024 (Paper II)
6
Consider the given number $(45)_y$ where $y$ is the base of the number. Some of the possible values of $y$ are given be…
Topic: UGC NET Computer Science August 2024 (Paper II)
7
Match List - I with List - II.&nbsp;List - IList - II&nbsp;&nbsp;(A) HTML&nbsp;(I) Allow for dynamic and interactive we…
Topic: UGC NET Computer Science August 2024 (Paper II)
8
Arrange the following stages of parsing in the correct order as they typically occur in the compilation process.(A) Lex…
Topic: UGC NET Computer Science August 2024 (Paper II)
9
Let $G(V,E)$ be an undirected graph with $|E|$ edges. Then the sum of degree of all vertices is equal to ______.
Topic: UGC NET Computer Science August 2024 (Paper II)
10
______ is a Self Balancing binary search tree, where the path from the root to the furthest leaf is no more than twice …
Topic: UGC NET Computer Science August 2024 (Paper II)
Ask Your Question or Put Your Review.

loading...