Capture by Value [=]

Easy Lambda Expressions
Solve in Playground →

Problem Statement

Write a C++ program using a lambda with value capture (`[=]`) to add a scaling factor to an input value.

Input Format

Multiplier factor F and integer X.

Output Format

Print the product of F and X.

Constraints

-1000 <= F, X <= 1000

Sample Input

5 10

Sample Output

50

Explanation

Value capture copies external variables into the lambda scope safely.

Starter Code

#include <iostream>

int main() {
    int factor, x;
    if (std::cin >> factor >> x) {
        // Write your value capture lambda logic here
    }
    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