当前位置: 动力学知识库 > 问答 > 编程问答 >

dev c++ - I'm trying to do exponent in c, but this is what is get

问题描述:

I'm trying to do a example of exponent en " DEV C++ " compilator and I can't get the output

this is the code :

#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;

}

and i get this :

what could be the problem ?

Sincerilly,

NIN.

网友答案:

You showed us the code from exponente.c (I guess), but the error message in the screenshot says:

error in math.h
included from teorema.c

So you should read the error messages very carefully and look for the buggy code in the other file.

网友答案:

It's important to remember that I'm using DEV c++, which have lot of errors and libraries which doesn't work.

I download GCC and MinGW for windows. I compile the same source code in MS-Dos and it worked.

I guess finally I going to use just GCC and I'll forget DEV C++.

分享给朋友:
您可能感兴趣的文章:
随机阅读: