General Computer Programming Quiz

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Squiva
S
Squiva
Community Contributor
Quizzes Created: 1 | Total Attempts: 7,883
Questions: 10 | Attempts: 8,000

SettingsSettingsSettings
General Computer Programming Quiz - Quiz

There different types of programming languages in use today and we have been able to cover each of the major ones in depth. Do you feel like you understood them all, when and how to apply them? In this quiz you will get to review all you know about Java, , and C++. Give it a shot and be sure to keep revising!


Questions and Answers
  • 1. 

    What does HTML stand for?

    • A.

      Hyper Trainer Marking Language

    • B.

      Hyper Text Marketing Language

    • C.

      Hyper Text Markup Language

    • D.

      Hyper Text Markup Leveler

    Correct Answer
    C. Hyper Text Markup Language
    Explanation
    HTML stands for Hyper Text Markup Language. It is a standard markup language used for creating and structuring the content on web pages. HTML uses tags to define elements such as headings, paragraphs, images, links, and more. These tags provide a structure and format to the content, allowing web browsers to interpret and display the information correctly. HTML is the foundation of web development and is essential for creating and designing websites.

    Rate this question:

  • 2. 

    Does the following C++ script have errors? #include "stdafx.h" #include <iostream> using namespace std; int main() {          cout<<"Hello world"<<endl          return 0; }

    • A.

      Yes

    • B.

      No

    Correct Answer
    A. Yes
    Explanation
    The given C++ script has errors because there is a missing semicolon (;) after the cout statement.

    Rate this question:

  • 3. 

    In Java, a method is a container that holds classes.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    In Java, a method is not a container that holds classes. A method is a block of code that performs a specific task and is defined within a class. It is used to encapsulate a set of instructions that can be called and executed when needed. Classes, on the other hand, are used to define objects and their properties and behaviors. Therefore, the statement that a method is a container that holds classes is incorrect.

    Rate this question:

  • 4. 

    <h1>Text</h1> is the correct way of making a header in HTML.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    In HTML, the tag is used to create a header, and it is the correct way to make a header in HTML. The tag represents the highest level of heading and is typically used for main headings on a webpage. It is important to use the appropriate HTML tags to structure and format the content correctly, and in this case, using the tag for a header is the correct approach.

    Rate this question:

  • 5. 

    Which of the following is the correct way of making a string in Java?

    • A.

      String "Text";

    • B.

      String text = 'text';

    • C.

      String text = "text"

    • D.

      String text = "text";

    Correct Answer
    D. String text = "text";
    Explanation
    The correct way of making a string in Java is by using double quotation marks. Therefore, the correct answer is "String text = "text";".

    Rate this question:

  • 6. 

    Which of the following is the correct way to use the standard namespace in C++?

    • A.

      Using namespace std;

    • B.

      Using namespace standard;

    • C.

      Using standard namespace;

    • D.

      Standard namespace used;

    Correct Answer
    A. Using namespace std;
    Explanation
    The correct way to use the standard namespace in C++ is by using the statement "using namespace std;". This statement allows you to access all the standard library functions and objects without having to specify the "std::" prefix every time.

    Rate this question:

  • 7. 

    Is this HTML code correct? <html> <head> <title>Title</title> </head> <h1>Header</h1> <p>Paragraph</p> </html>

    • A.

      Yes

    • B.

      No

    Correct Answer
    B. No
    Explanation
    The HTML code is not correct because the and elements should be placed inside the element, not directly inside the element.

    Rate this question:

  • 8. 

    Is it less bytes to use:       long l = 100; then:       int i = 10;

    • A.

      Yes

    • B.

      No

    Correct Answer
    B. No
    Explanation
    The given answer "No" is correct because both variables, long and int, occupy the same amount of memory in Java. The difference lies in the range of values they can hold. A long variable can store larger values than an int variable, but it does not necessarily use more memory. In this case, both variables are assigned small values, so they would occupy the same number of bytes.

    Rate this question:

  • 9. 

    Is this the correct way to make an object in Java? Class class = new Class();

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    In Java, "Class" is a reserved keyword used for reflection to obtain metadata about classes at runtime. Therefore, naming a variable "class" may lead to confusion. A correct way to instantiate an object of a class named "Class" would be: 
    Class className = new Class();

    Rate this question:

  • 10. 

    Is this how you import something in C++? #include <string>

    • A.

      No

    • B.

      Yes

    Correct Answer
    B. Yes
    Explanation
    In C++, the #include directive is used to import libraries or header files, and <string> is a standard C++ header file that provides functions and classes for working with strings. So, #include <string> is used to include the functionality related to strings in your C++ program.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Apr 01, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 04, 2013
    Quiz Created by
    Squiva
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.