Hello ,
I am making a simple program for float and just want to take values from users as input.
The program is as follows:
------------------------------------------------------------------------
----------------------------------------------------------------------Code:#include<iostream> using namespace std; float i; float x=2.5; float y=7.5; main() { cout<<" pls enter a number"<< endl; cin>>i; if (i<5 && i==x) { cout<<"x="; cout<<x; } else cout<<" pls enter a number either 2.5 or 7.5"<<endl; if (i<10 && i==y) { cout<<"i="; cout<<y; } else cout<<"pls enter either a number 2.5 or 7.5"<<endl; system("pause");
when I compile this program using "Dev++" , it gives me an error at the bottom as:
"no new line at the end of the file"
Can you pls tell me what exactly is the mistake that I am doing?
Thanks