#include<stdio.h>

int multiply(int a, int b);  //函数声明

int main()
{
    int a, b;
    printf("请输入两个整数:");
    scanf("%d%d", &a, &b);
    int s = multiply(a, b);  //调用函数计算乘积
    printf("%d * %d = %d\n", a, b, s);
    return 0;
}

int multiply(int a, int b)  //函数定义
{
    int s = a * b;
    return s;
}
C语言代码示例:用函数计算两个整数的乘积

原文地址: https://www.cveoy.top/t/topic/oDRK 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录