Been learning C++ in a class, but for one of the exercises I've been getting a [Warning] Integer Overflow in [-Woverflow], what's causing the problem and how do I fix it? (The program is meant to calculate the output of complete matter->energy transformation in Joules, and here it is)
#include <iostream>
using namespace std;
int main()
{
long antimass = 0;
//long amosus = 0;
cout<< "Breakdown, M\n 3-23\n Exersize 5\n";
cout<< "Enter The Mass of your antimatter (in grams)!\n";
cin >> antimass;
//amosus = antimass%1000;
cout<< "output in joules = "<< (antimass%1000*(299792458*299792458))<<endl;
}