Nagarro Aptitude Test Papers
11 / 79
Which of the following function is correct that finds the length of a string?
Aint xstrlen (char *s) { int length=0; while (*s!='\0) { length++; s++; } return (length); }
Bint xstrlen (char s) { int length=0; while (*s!='\0') { length++; s++; } return (length); }
Cint xstrlen (char *s) { int length=0; while (*s!='\0') { length++; } return (length); }
Dint xstrlen (char *s) { int length=0; while (*s!='\0') { s++; } return (length); }
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
12 / 79
Declare the following statement ?
"An Array of three pointers to chars"
Achar *ptr[3]();
Bchar *ptr[3];
Cchar (*ptr[3]) ();
Dchar **ptr[3];
Answer: Option B
Explanation:Here is no explanation for this answer
ShortCut By :: Srishtic
Submit Your Solution
13 / 79
How will you print \n on the screen ?
Aprintf(“\n”);
Becho \\n;
Cprintf(“\n”);
Dprintf(\\n);
Answer: Option D
Explanation:The statement printf("\\n"); prints '\n' on the screen.
Submit Your Solution
14 / 79
The use of the break statement in switch statement is
Aoptional
Bcompulsory
Cnot allowed. It gives an error message
Dto check an error
ENone of the above
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
15 / 79
What logic function is produced by adding an inverter to each input and the output of and OR gate?
ANAND
BNOR
CXOR
DAND
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
16 / 79
Conversion of binary number 11110 to hexadecimal is
A36
B30
CF0
D1E
Answer: Option D
Explanation:Here is no explanation for this answer
Submit Your Solution
17 / 79
Let P be a quick sort program to sort numbers in ascending order using the first element as the pivot. Let t1 and t2 be the number of comparisons made by P for the input [1 2 3 4 5] and [4 1 5 3 2] respectively. Which one of the following holds?
At1 = 5
Bt1 < t2
Ct1 > t2
Dt1 = t2
Answer: Option C
Explanation:When first element or last element is chosen as pivot, Quick Sort's worst case occurs for the sorted arrays.
In every step of quick sort, numbers are divided as per the following recurrence.
T(n) = T(n-1) + O(n)
As same sort program is used therefore t1=t2.
Submit Your Solution
18 / 79
Identify the correct order in which the following actions take place in ad interaction between web browser and web server.
1) The web browser request a webpage using HTTP.
2) The web browser establish a TCP connection with the web server.
3) The web web server send the requested webpage using HTTP.
4) The web browser resolves the domain name using DNS.
A4,2,1,3
B1,2,3,4
C4,1,2,3
D2,4,1,3
Answer: Option A
Explanation:Here is no explanation for this answer
Submit Your Solution
19 / 79
The Boolean expression AB + AB' + A'C + AC is unaffected by the value of Boolean variable:
AA
BB
CC
DD
ENone of the above
Answer: Option B
Explanation:AB + AB' + A'C + AC = A(B + B') + (A' +A)C
= A(1) + (1) C = A + C = B
Submit Your Solution
20 / 79
Consider the C function given below. Assume the array listA contains (n>0) elements, sorted in ascending order.
int Process array (int * list A, int x, int n)
{
int i, j, k;
i =0;j=n-1;
do {
k = (i+j)/2;
if (x<=list A[k])
j=k-1;
if (list A[k] <=x)
i =k+1;
} while (i <=j);
if (list A[k] == x)
return (k);
else
return -1;
}
AIt will run into an infinite loop when x is not in listA
BIt is an implementation of binary search.
CIt will always find the maximum element in listA.
DIt will return -1 even when x is present in listA.
Answer: Option B
Explanation:Here is no explanation for this answer
Submit Your Solution
Here is the list of questions asked in Aptitude Test for Nagarro Nagarro Aptitude Test Papers. Practice Nagarro Written Test Papers with Solutions and take Q4Interview Nagarro Online Test Questions to crack Nagarro written round test. Overall the level of the Nagarro Online Assessment Test is moderate. Only those candidates who clear the written exam will qualify for the next round, so practic all the questions here and take all the free tests before going for final selection process of Nagarro