int to float c++

#include <iostream>
using namespace std;

int main() {
    int integerNumber = 10;
    float floatNumber = static_cast<float>(integerNumber);

    cout << "Integer Number: " << integerNumber << endl;
    cout << "Float Number: " << floatNumber << endl;

    return 0;
}
  1. Include necessary header files.
  2. Declare the main function.
  3. Define an integer variable integerNumber and initialize it with the value 10.
  4. Declare a float variable floatNumber.
  5. Use static_cast<float> to convert integerNumber to a float type and assign the result to floatNumber.
  6. Display the original integer value and the converted float value using cout.
  7. Return 0 to indicate successful execution.