c - 我正在尝试用 c 计算指数,但这就是得到的

标签 c dev-c++

我正在尝试做一个“DEV C++”编译器的指数示例,但无法获得输出

这是代码:

#include <stdio.h>
#include <math.h>

int main (void)
{
    double base, exponent, result;

    printf("La base:\n");
    scanf("%lf",&base);
    printf("El exponente:\n");
    scanf("%lf",&exponent);

    result = pow(base, exponent);

    printf("%.1lf^%.1lf = %.21f",  base, exponent, result);

    return 0;       
}

我明白了:

exponent

可能是什么问题?

真诚的, 宁。

最佳答案

您向我们展示了 exponente.c 中的代码(我猜),但屏幕截图中的错误消息显示:

error in math.h
included from teorema.c

因此,您应该非常仔细地阅读错误消息,并在其他文件中查找有错误的代码。

关于c - 我正在尝试用 c 计算指数,但这就是得到的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38577766/

相关文章:

C 程序将 2 个整数相加产生异常输出

c - 带有 fscanf 的 EXC_BAD_ACCESS

c - 我无法在 Dev c++ 中编译简单的 C 函数程序?

c++ - 如何使用C++计算字符串中的特定单词

compiler-errors - 编译器未显示错误消息

c++ - 这段代码有什么问题?斐波那契数列

我们可以说 "C language operators are polymorphic"吗?

c - 是否可以将多个值从外部文件返回到 Dymola?

c - 如何识别用户输入的字符串中的所有元音

c - rename() 在使用 Dev C++ 编译的 C 程序中不起作用