📜  函数返回浮点C++代码示例

📅  最后修改于: 2022-03-11 14:44:57.094000             🧑  作者: Mango

代码示例1
#include 

float sum(float a, float b)
{
    return a+b;
}
int main(int argc, char *argv[])
{

    float num1 = 10.2;
    float num2 = 15.3;
    float result = sum(num1,num2);
    std::cout<< result;
    return 0;
}