Time Left - 10:00 mins

ISRO CS 2017 Exam : PDS Quiz Day -1

Attempt now to get your rank among 1547 students!

Question 1

A Three dimensional array in ‘C’ is declared as int A[x][y][z]. Here, the address of an item at the location A[p][q][r] can be computed as follows (where w is the word length of an integer):

Question 2

Consider the program below in a hypothetical programming language which allows global variables and a choice of static or dynamic scoping
int i;
program main( )
{
   i = 10;
   call f ( );
}
procedure f( )
{
  int i = 20;
  call g ( );
}
procedure g( )
{
 print i;
}

Let x be the value printed under static scoping and y be the value printed under dynamic scoping. Then x and y are

Question 3

printf(“%c”, 100);

Question 4

What would be the output of the following program, if run from the command line as “myprog 1 2 3” ?
main (int argc, char * argv[ ])
{
int i ;
i = argv [1] + argv [2] + argv[3] ;
printf (“% d”, i);
}

Question 5

The _________ memory allocation function modifies the previous allocated space.

Question 6

What is the value of ‘b’ after the execution of the following code statements:
c = 10;
b = + + c + + + c;

Question 7

#include<stdio.h>
#define N 2
main()
{
int arr1[N];
int k=N*2;
int arr2[k];
for(int I=0; I<k;I++)
scanf(“%d”,&arr2[I]);
printf(“%d”,((arr2+1)-(arr2++));
}
What is/are true about above code if inputs are 3,7,2,9?
I) 1st error occurs in 1st line of main function
II) 1st error occurs in 3rd line of main function
III) Error occurs in last line of main function
IV) No error ,it prints 0 as output.

Question 8

main()
{
  int k;
  char *str1=”Gradestack”;
  char *str2=”Gradestack”;
  k=(strlen(str1)/(strcmp(str1+3,&str2[3])));
  printf(“%d”,k);
}

Question 9

The following postfix expression with single digit operands is evaluated using a stack 8 2 3 ^ / 2 3 * + 5 1 * -. Note that ^ is the exponentiation operator. The top two elements of the stack after the first * is evaluated are:

Question 10

#include <stdio.h>
#include<string.h>
void main()
{
if(strlen("computer")==08)
printf("strlen function doesn't count null character at the end of the string ");
else
printf("strlen function count null character at the end of the string ");
}
What is the output?
  • 1547 attempts
  • 11 upvotes
  • 11 comments
Apr 2GATE & PSU CS