I was solving a question and suddenly amazed to know that we are getting 2 as output, however the output should be something like 2.000000.
#include <iostream>
using namespace std;
int main()
{
double a = 6 / 4;
int b = 6 / 4;
double c = a + b;
cout << c;
}
Why the output is 2? Why there are no decimal values in the answer.