Create a `Collection` class encapsulating an integer array. Implement `int* begin()` and `int* end()` methods so that C++ range-based for loops can iterate over the object directly. Add a method `void add(int v)`. Read N, insert N integers, and then use `for (int val : collection)` to print them separated by spaces.
Integer N, followed by N integers.
Print the elements separated by space.
1 <= N <= 100
3 10 20 30
10 20 30
C++ range-based for loops implicitly look for `begin()` and `end()` methods on objects. Providing them seamlessly integrates custom classes with STL loop structures.
#include <iostream>
class Collection {
int arr[100];
int sz = 0;
public:
// Implement add(), begin(), and end()
};
int main() {
// Setup collection and use range-based for loop
return 0;
}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