-2
Error: invalid operands of types 'float' and 'float' to binary 'operator^'오류 : 형식이 'float'이고 연산자가 'float'인 잘못된 피연산자
이 오류가 발생하는 이유를 누군가 말해 줄 수 있습니까?
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
int a,w;
float P,M,y,i,n;
for(a=1;a=2;)
{
printf("Enter the value of Pricipal \n");
scanf("%f",&P);
printf("Enter the value of yearly interest rate \n");
scanf("%f",&y);
i=y/12;
printf("Enter Term in years \n");
scanf("%d",&w);
n=w*12;
M=(P*i*((1+i)^n))/(((1+i)^n)-1);
printf("Monthly Payment is %f \n",M);
}
}
코드에'1.2^2.0' 같은 것이 있습니까? – user463035818
코드를 표시하십시오 – atb
['pow'] (http://en.cppreference.com/w/cpp/numeric/math/pow)를 찾고 계십니까? –