programming languages Online Quiz - 292

Description: programming languages Online Quiz - 292
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

main() { signed int bit=512, i=5; for(;i;i--) { printf("%dn", bit = (bit >> (i - (i -1)))); } }

  1. Compile error

  2. 256256256256256

  3. 55555

  4. runtime error

Correct Option: B

void main(){ print(“%d”,printf(“What this prints”)) };

  1. Compile error

  2. What this prints

  3. 11

  4. 15

Correct Option: D

void main(){ print(“%d”,scanf(“%s”)) };

  1. Compile error

  2. 11

  3. Hello world

  4. 5

Correct Option: B

void main() { int x=20,y=35; x= y++ + x++; y= ++y + ++x; printf(" %d %d" , x,y); }

  1. x=57 & y=94

  2. x=57,y=55

  3. X = 57 Y= 93

  4. X = 37 Y= 65

Correct Option: A

Which group has had the most impact on modern object-oriented programming practices?

  1. The Gang of Four

  2. The Party of Five

  3. The soft-drink industry

  4. AC/DC

Correct Option: A
  1. Don't link your modules to modules written in any other language

  2. Make sure you declare all your variables' data types ahead of time

  3. Don't add variables of one type to variables of another

  4. Devout prayer

Correct Option: D

Just-in-time (JIT) compilation improves the performance of languages that compile into bytecode. Which language featured the first JIT compiler?

  1. Java

  2. C#

  3. Smalltalk

  4. Cobol

Correct Option: C

If I told you a key characteristic of my programming language of choice was that it generated threaded code which language would I most likely be talking about?

  1. Pascal

  2. Java

  3. Forth

  4. Python

Correct Option: C

Your local supermarket is all sold out of energy drinks Jolt Cola and Mountain Dew. Which beverage will keep you going packing the most caffeine and sugar into a 12-ounce can?

  1. Sunkist Orange Soda

  2. Coca-Cola Classic

  3. Pepsi-Cola

  4. Dr. Pepper

Correct Option: A

Which of the following is NOT a central tenet of extreme programming?

  1. Refactor your code often

  2. Throw away obsolete code

  3. Debugging is for wimps

  4. Communicate often with the customer

Correct Option: C

What is the relationship between Java and JavaScript?

  1. Netscape invented JavaScript as a stripped-down "lite" version of Java

  2. Java borrowed ideas from JavaScript and made it a full-fledged programming language

  3. They both originate from the same research at Sun Microsystems

  4. There is none; it's all just marketing

Correct Option: D

Why do some consider Ruby to be more "purely" object-oriented than other more popular OOP languages such as Java and C++?

  1. Because Ruby forces object orientation and does not permit procedural or functional style code

  2. Because Ruby makes no distinction between objects and primitive types

  3. Because Ruby's syntax is similar to that of Perl

  4. Because Ruby programmers are full of themselves

Correct Option: B

Failure to validate user input is one of the most common sources of software security vulnerabilities. When is it safe to accept user input without validation?

  1. When the application is running behind a firewall

  2. Never; any program that accepts input can be exploited

  3. When the application is written in Perl using the language's "taint mode"

  4. When the user is your own mother

Correct Option: B

Which of the following is the best way to write reusable code that is easier to maintain?

  1. Use more global variables

  2. Keep variable and function names down to one or two letters

  3. Insert comments throughout your source code files

  4. Use pointer arithmetic wherever possible

Correct Option: C

Of the following who is NOT the inventor of a programming language in current use?

  1. Andrew S. Tanenbaum

  2. Guido van Rossum

  3. Niklaus Wirth

  4. Bjarne Stroustrup

Correct Option: A

To what concept does "the mythical man-month" refer?

  1. The code that would have been written last month if your project was on deadline

  2. The amount of code that you can produce in a month on your salary

  3. The fallacy that assigning more staff to a programming job will complete it faster

  4. The fact that like Sysiphus pushing the boulder you can never finish debugging

Correct Option: C

Hungarian Notation is a variable-naming convention used by some programmers. How did it get its name?

  1. It was called that because of its similarity to Reverse Polish Notation

  2. Its inventor was Hungarian

  3. When you read it out loud it sounds like you're speaking Hungarian

  4. It was invented at the Polytechnic University of Bucharest in Hungary

Correct Option: B
- Hide questions