Computer scienceProgramming languagesC++Operators and expressions

Arithmetic operators

Theory

Find x

Report a typo

What will be the output of the following code?

#include <iostream>

int main() {

    float x = 5.25;
    float y = static_cast<int>(x);
    int z = static_cast<int>(x);

    std::cout << y << std::endl;
    std::cout << z << std::endl;
    
    return 0;

}

Select one option from the list
___

Create a free account to access the full topic