My console app looks like that.
#include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a, b;
cin>>a>>b;
cout<<"% "<<a%b<<endl<<"fmod "<<fmod(a,b)<<endl;
system("pause");
return 0;
}
I'm newbie to C++ and I got 2 questions:
- Writing this application on VS. Why do I need to include "stdafx.h"? Is there any requirement? What is this?
- Is there any difference between
fmod
and%
? Getting exactly same results for them:
Thx in advance..