Programming Languages Fundamentals
A comprehensive quiz covering concepts from COBOL, C, C++, and Java programming languages including syntax, features, and historical context.
Questions
"toString" is a method of Class String.
- True
- False
Are JavaBeans J2EE Component
- True
- False
Can you instantiate "Math" class
- True
- False
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); }
- Compile error
- ave=43.33
- link error
- ave= 43.00
What would be the output of the following: class A { A() const; //... };
- Compile-Time Error
- Run time error
- Default construtor is called
- none of the above
main(){ int x=5; printf("%d %d %d\n", x,x<<2,x=x>>2); }
- 5 4 1
- 1 4 1
- 5 20 1
- Compile error
main(){ int a,b; a=0; b=(a=1)?2:3; printf("%d %d",a,b); }
- 1 3
- 1 2
- 0 3
- Compile Error
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
- 2
- 3
- nullpointer assignment
abc(){ _AX = 1000;} main(){ int i; i = abc(); printf("%d",i); }
- 1000
- garbage value
- undefined symbol _AX
- none of these
What is the output of the following? int main() { ... int *p=new int(87); ... }
- compile time error
- run time error
- p is initialized to 87
- space for an array of 87 integers is allocated
The cast operator used for casting inherently incompatible pointer types
- reinterpret_cast
- static_cast
- dynamic_cast
- const_cast
When a virtual function is inherited, its virtual nature is also inherited.
- True
- False
WHICH OF THE FOLLOWING WAS NOT A BUSINESS SYSTEM LANGUAGE
- FLOW MATIC
- COBOL
- PASCAL
- COMTRAN
WHICH OF THE FOLLOWING HAVE BEEN INHERITED FROM FLOW MATIC INTO COBOL
- PROCEDURE DIVISION, DATA DIVISION, ENVIRONMENT DIVISION
- PROCEDURE DIVISION, FILE-CONTROL, INPUT-OUTPUT
- ENVIRONMENT DIVISION, IDENTIFICATION DIVISION, WORKING-STORAGE SECTION
- WORKING-STORAGE SECTION, DATA DIVISION, FILE SECTION
WHICH OF THE FOLLOWING WAS NOT THE APPROVER OF COBOL STANDARDS?
- ANSI
- USASI
- ASI
- CODASYL
WHICH OF THE FOLLOWING IS THE FIRST ISO APPROVED VERSION OF COBOL?
- COBOL-68
- COBOL-74
- COBOL-85
- COBOL-9x
FROM WHICH OF THE FOLLOWING EARLIER LANGUAGES, THE USE OF PICTURE CLASS HAS BEEN BORROWED INTO COBOL?
- FORTRAN
- COMPTRAN
- FLOW MATIC
- PASCAL
WHAT WAS THE EARLY NAME OF COBOL AS NAMED BY CODASYL COMMITTEE?
- Common Business Oriented Language
- Common Business Language
- Business Oriented Language
- Business Language
WHEN WAS THE FIRST VERSION OF COBOL RELEASED?
- 1958
- 1960
- 1968
- 1975
WHICH OF THE FOLLOWING COMMITTEES WERE MERGED AFTER THE RELEASE OF COBOL-85 TO FORM THE NOW-EXISTING COBOL STANDARDIZATION COMMITTEE(J4)?
- CODASYL AND X3J4
- CODASYL AND X3
- CODASYL AND CCC
- CCC AND X3J1