Use an ifstream object named indata to read the first three integers from a file
ID: 3640405 • Letter: U
Question
Use an ifstream object named indata to read the first three integers from a file called lottowins and write each number to standard output, on a line by itself. Assume that this is the extent of the input that this program will do.This is what I have, I know it could of been wrote a bit easier but I wanted to break it down to see mabe what it is that I am doing wrong?
int num1,num2,num3;
indata.open("lottowins");
indata >> num1;
cout << num1;
indata >> num2;
cout << num2;
indata >> num3;
cout << num3;
indata.close ();