Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. using namespace std;
  2. #include<fstream>
  3. #include<iostream>
  4.  
  5. int main(){
  6. ifstream fin;
  7. ofstream fout;
  8. int a=235,b=237;
  9. fout.open("temp.txt");
  10. fout<<a<<endl;
  11. fout<<b<<endl;
  12. fout.close();
  13. fin.open("temp.txt");
  14. int temp;
  15. while(fin.eof()!=1){
  16. fin>>temp;
  17. cout << temp;
  18. }
  19. fin.close();
  20. return 0;
  21.  
  22. output should be:235237
  23. but instead of this ,,it is showing :235237237
  24. hence,it is showing 237 2 times.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement