C++ adding int and float variables
C++ adding int and float variables
In this example, we show how to find the sum of 2 variables of type int and float.
#include <iostream>
int main() {
int firstNumber = 11;
float secondNumber = 12.8;
float sum = firstNumber + secondNumber;
std::cout << "Sum: " << sum << std::endl;
return 0;
}
Last updated on