-2
Error: invalid operands of types 'float' and 'float' to binary 'operator^'エラー: 'float'型と 'float'型の無効なオペランドがバイナリ 'operator ^'
このエラーが発生している理由を教えてもらえますか?
#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://ja.cppreference.com/w/cpp/numeric/math/pow)をお探しですか? –