Modifying Static Data Globally

Easy Static Members & Friend Functions
Solve in Playground →

Problem Statement

Using the `Company` class with a public static `employee_count` initialized to 0, read an integer from input in `main()`. Assign this integer directly to the static variable using the scope resolution operator (`Company::employee_count = …`) before creating any objects. Print ‘Updated Count: [count]’.

Input Format

A single integer.

Output Format

Print the updated static variable.

Constraints

None

Sample Input

50

Sample Output

Updated Count: 50

Explanation

Static members can be accessed and modified directly via the class name without instantiating any objects.

Starter Code

#include <iostream>

class Company {
public:
    // Declare static employee_count
};

// Initialize static employee_count

int main() {
    // Read input, modify static member globally, and print
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used