次のように2つの数値のモジュラスを見つけるC++で非常に単純なプログラムを作成しようとしています。
#include <iostream>
using namespace std;
int n;
int d;
int modulus;
int main()
{
cout<<"***Welcome to the MODULUS calculator***";
cout<<"Enter the numerator, then press ENTER: ";
cin>>n;
cout<<"Enter the denominator, then press ENTER: ";
cin>>d;
modulus=n%d;
cout<<"The modulus is ---> "<<modulus;
return 0;
}
しかし、コンパイルしようとすると、次のようになります。
これはどのように解決できますか?
ありがとう。