Review of C Programming

Unit 1 Β· Topic 1.4⏱ 8 min read❓ 5 MCQs

Introduction

C++ builds on C. Reviewing C fundamentals (variables, control flow, functions, arrays, pointers) is essential before OOP.

Definition

C: A procedural language; C++ is a superset adding OOP features.

C++ (C-style) Example

#include <iostream>
using namespace std;
int main(){
    int a=5,b=10;
    cout<<(a+b)<<endl;
    return 0;
}

Important Questions

Short Questions

  1. What is C?
  2. Name C data types.
  3. What is a pointer?
  4. Difference between array and pointer?

Long Questions

  1. Explain C fundamentals used in C++.
  2. Discuss pointers in C.

MCQ Practice

1. C is a:

  • Procedural language
  • OOP language
  • Functional language
  • Markup language
Answer: procedural.

2. C++ is a:

  • Superset of C
  • Subset of C
  • Replacement of C
  • Unrelated
Answer: superset.

3. Entry point in C/C++ is:

  • main()
  • start()
  • begin()
  • init()
Answer: main().

4. Arrays in C are:

  • Zero-indexed
  • One-indexed
  • Dynamic by default
  • Objects
Answer: zero-indexed.

5. Pointers store:

  • Memory addresses
  • Values only
  • Types
  • Functions
Answer: memory addresses.

Quick Revision

  • C++ extends C.
  • Core: variables, control flow, functions, arrays, pointers.