Programming Languages Fundamentals

A comprehensive quiz covering concepts from COBOL, C, C++, and Java programming languages including syntax, features, and historical context.

20 Questions Published

Questions

Question 1 True/False

"toString" is a method of Class String.

  1. True
  2. False
Question 2 True/False

Are JavaBeans J2EE Component

  1. True
  2. False
Question 3 True/False

Can you instantiate "Math" class

  1. True
  2. False
Question 4 Multiple Choice (Single Answer)

main(){ int i=100,j=10,k=20; int sum; float ave; char myformat[]="ave=%.2f"; sum=i+j+k; ave=sum/3; printf(myformat,ave); }

  1. Compile error
  2. ave=43.33
  3. link error
  4. ave= 43.00
Question 5 Multiple Choice (Single Answer)

What would be the output of the following: class A { A() const; //... };

  1. Compile-Time Error
  2. Run time error
  3. Default construtor is called
  4. none of the above
Question 6 Multiple Choice (Single Answer)

main(){ int x=5; printf("%d %d %d\n", x,x<<2,x=x>>2); }

  1. 5 4 1
  2. 1 4 1
  3. 5 20 1
  4. Compile error
Question 7 Multiple Choice (Single Answer)

main(){ int a,b; a=0; b=(a=1)?2:3; printf("%d %d",a,b); }

  1. 1 3
  2. 1 2
  3. 0 3
  4. Compile Error
Question 8 Multiple Choice (Single Answer)

struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main(){ struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1; def.prev=&abc; def.next=&ghi; ghi.i=2; ghi.prev=&def; ghi.next=&jkl; jkl.i=3; jkl.prev=&ghi; jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }

  1. 1
  2. 2
  3. 3
  4. nullpointer assignment
Question 9 Multiple Choice (Single Answer)

abc(){ _AX = 1000;} main(){ int i; i = abc(); printf("%d",i); }

  1. 1000
  2. garbage value
  3. undefined symbol _AX
  4. none of these
Question 10 Multiple Choice (Single Answer)

What is the output of the following? int main() { ... int *p=new int(87); ... }

  1. compile time error
  2. run time error
  3. p is initialized to 87
  4. space for an array of 87 integers is allocated
Question 11 Multiple Choice (Single Answer)

The cast operator used for casting inherently incompatible pointer types

  1. reinterpret_cast
  2. static_cast
  3. dynamic_cast
  4. const_cast
Question 12 True/False

When a virtual function is inherited, its virtual nature is also inherited.

  1. True
  2. False
Question 13 Multiple Choice (Single Answer)

WHICH OF THE FOLLOWING WAS NOT A BUSINESS SYSTEM LANGUAGE

  1. FLOW MATIC
  2. COBOL
  3. PASCAL
  4. COMTRAN
Question 14 Multiple Choice (Single Answer)

WHICH OF THE FOLLOWING HAVE BEEN INHERITED FROM FLOW MATIC INTO COBOL

  1. PROCEDURE DIVISION, DATA DIVISION, ENVIRONMENT DIVISION
  2. PROCEDURE DIVISION, FILE-CONTROL, INPUT-OUTPUT
  3. ENVIRONMENT DIVISION, IDENTIFICATION DIVISION, WORKING-STORAGE SECTION
  4. WORKING-STORAGE SECTION, DATA DIVISION, FILE SECTION
Question 15 Multiple Choice (Single Answer)

WHICH OF THE FOLLOWING WAS NOT THE APPROVER OF COBOL STANDARDS?

  1. ANSI
  2. USASI
  3. ASI
  4. CODASYL
Question 16 Multiple Choice (Single Answer)

WHICH OF THE FOLLOWING IS THE FIRST ISO APPROVED VERSION OF COBOL?

  1. COBOL-68
  2. COBOL-74
  3. COBOL-85
  4. COBOL-9x
Question 17 Multiple Choice (Single Answer)

FROM WHICH OF THE FOLLOWING EARLIER LANGUAGES, THE USE OF PICTURE CLASS HAS BEEN BORROWED INTO COBOL?

  1. FORTRAN
  2. COMPTRAN
  3. FLOW MATIC
  4. PASCAL
Question 18 Multiple Choice (Single Answer)

WHAT WAS THE EARLY NAME OF COBOL AS NAMED BY CODASYL COMMITTEE?

  1. Common Business Oriented Language
  2. Common Business Language
  3. Business Oriented Language
  4. Business Language
Question 19 Multiple Choice (Single Answer)

WHEN WAS THE FIRST VERSION OF COBOL RELEASED?

  1. 1958
  2. 1960
  3. 1968
  4. 1975
Question 20 Multiple Choice (Single Answer)

WHICH OF THE FOLLOWING COMMITTEES WERE MERGED AFTER THE RELEASE OF COBOL-85 TO FORM THE NOW-EXISTING COBOL STANDARDIZATION COMMITTEE(J4)?

  1. CODASYL AND X3J4
  2. CODASYL AND X3
  3. CODASYL AND CCC
  4. CCC AND X3J1