• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

Principles of Programming Languages

Question 21

Which of the following is not typically a benefit of dynamic linking? I. Reduction in overall program execution time. II. Reduction in overall space consumption in memory. III. Reduction in overall space consumption on disk. IV. Reduction in the cost of software updates.
  • I and IV
  • I only
  • II and III
  • IV only

Question 22

Match the following types of variables with the corresponding programming languages: 20
  • (1)
  • (2)
  • (3)
  • (4)

Question 23

Which of the following is false regarding the evaluation of computer programming languages ?

  • Application oriented features

  • Efficiency and Readability

  • Software development

  • Hardware maintenance cost

Question 24

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?
  • x + x2/2 + x3/3 + x4/4 +...
  • x + x2/2! + x3/3! + x4/4! +...
  • 1 + x2/2 + x3/3 + x4/4 +...
  • 1 + x2/2! + x3/3! + x4/4! +...

Question 25

Match the following w.r.t. programming language: 9
  • (1)
  • (2)
  • (3)
  • (4)
  • No option is correct.

Question 26

What is the output of the following program? (Assume that the appropriate preprocessor 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 */		
     }
  • ABCDEFGH1000
  • CDEFGH1000
  • DDEFGHH1000
  • DEFGH1000

Question 27

Language model used in LISP is __________.
  • Functional programming
  • Logic programming
  • Object oriented programming
  • All of the above

Question 28

Consider the following code written in a pass-by-reference language like FORTRAN and these statements about the code.
subroutine swap(ix,iy)
it = ix
L1 : ix = iy
L2 : iy = it
end
ia = 3
ib = 8
call swap (ia, ib+5)
print *, ia, ib
end
S1: The compiler will generate code to allocate a temporary nameless cell, initialize it to 13, and pass the address of the cell to swap S2: On execution the code will generate a runtime error on line L1 S3: On execution the code will generate a runtime error on line L2 S4: The program will print 13 and 8 S5: The program will print 13 and -2 Exactly the following set of statement(s) is correct:
  • S1 and S2
  • S1 and S4
  • S3
  • S1 and S5

Question 29

What is the value of F(4) using the following procedure:
function F(K : integer)
integer;
begin
if (k<3) then F:=k 
else F:=F(k-1)*F(k-2)+F(k-3)
end;
  • 5
  • 6
  • 7
  • 8

Question 30

Repeated execution of simple computation may cause compounding of
  • round-off errors
  • syntax errors
  • run-time errors
  • logic errors

There are 35 questions to complete.

Last Updated :
Take a part in the ongoing discussion