#include <iostream>
#include<fstream.h>
#include<conio.h>
using namespace std;
int main(){
ifstream filein;
filein.open("nilai.dat");
int nilai[10];
for(int i=0; i<10; i++){
filein>>nilai[i];
cout<<"Nilai ke-"<<i+1<<"\t:"<<nilai[i]<<endl;
}
filein.close();
getch();
return 0;
}
Hasil: