Back to Blog

Name That Code! Programming Quiz #shorts #coding

Sandy LaneSandy Lane

Video: Name That Code! Programming Quiz #shorts #coding by Taught by Celeste AI - AI Coding Coach

Take the quiz on the full lesson page
Test what you've read · interactive walkthrough

Name That Code! Programming Quiz

This challenge tests your ability to recognize programming languages based on syntax. The snippet shown is from a language that introduced object-oriented features to C, created in 1979. Identifying such languages helps deepen your understanding of programming history and syntax differences.

Code

// Example of C++ code demonstrating a simple class
#include <iostream>

class HelloWorld {
public:
  void greet() {
    std::cout << "Hello, World!" << std::endl;
  }
};

int main() {
  HelloWorld hw;   // Create an object of the class
  hw.greet();      // Call the greet method
  return 0;
}

Key Points

  • C++ was created by Bjarne Stroustrup in 1979 as "C with Classes".
  • It extends the C language by adding object-oriented programming features.
  • Classes and objects are fundamental concepts introduced by C++.
  • The syntax includes features like methods inside classes and the use of << for output streams.
  • Recognizing language syntax helps in quickly identifying and understanding code snippets.
Ready? Take the quiz on the full lesson page →
Test what you've learned. Watch the lesson and try the interactive quiz on the same page.