Time Left - 05:00 mins

NIELIT Scientist –B Daily Quiz - 1 (PDS)

Attempt now to get your rank among 853 students!

Question 1

What is the output of the following programme? (Assume that the appropriate pre-processor directives are included and there is no syntax error)
Main ()
{ char S[] = “ABCDEFGH”;
printf(“%C”, *(&S[3]));
printf(“%s”, S + 4);
printf(“%u”, S);
/ * Base address of S is 1000 */
}

Question 2

Consider the following program:
#include<stdio.h>
main()
{
int i, inp;
float x, term = 1, sum = 0;
scanf(“%d %f”, &inp, & x);
for (i = 1; i < = inp; i ++)
{
term = term * x/i;
sum = sum + term;
}
Printf(“Result = %f\n”, sum);
}
The program computes the sum of which of the following series?

Question 3

Which of the following does not represent a valid storage class in ‘c’?

Question 4

If a base condition isn’t specified in a recursive program, what will it lead to?

Question 5

Consider the following recursive c function:
void ABC (int i)
{
if(i<1)
return;
ABC(i-2);
ABC(i-4);
printf(“%d”, i);
}
If ABC (6) function is being called in main () then how many times will the ABC() function be invoked before returning to the main()?
  • 853 attempts
  • 3 upvotes
  • 22 comments
Jun 3GATE & PSU CS