Help! I need C++

nipunn12

Regular Member
Joined
May 30, 2011
Messages
373
Reaction score
99
I need a version of C++ where i can practice ( Older code ). The type of code was supported by C++ 2005 I think but it does not work with 2008 or 2010 version.

Example : #include <iostream.h>void main()
{
float salary;
float ltax;
cout << "\n Enter the salary";
cin >> salary;
if (salary > = 9000)
ltax = salary * 0.4;
if ((salary > = 7500) && (salary , 8999))
ltax = salary * 0.3;
cout <"\n Income tax = ", ltax;
}
 
Not sure what you mean here? Just fire up a new CONSOLE application and get typing? In otherwords, in 2010 are you selecting the correct environment when you open up the program? Don't select .DLL or Windows Application etc, select CONSOLE and put your code in. I don't actually remember doing a console app in 2010, just .Dlls, so.. something might have changed, but... Just make sure you pick the right application, 2010 has a lot of options for that.
 
Last edited:
Code:
#include <iostream>
using namespace std;

int main()
{
float salary;
float ltax;
cout << "\n Enter the salary";
cin >> salary;
if (salary > = 9000)
ltax = salary * 0.4;
if ((salary > = 7500) && (salary , 8999))
ltax = salary * 0.3;
cout << "\n Income tax = " << ltax;
return 0;

}

Try that.
 
Last edited:
Back
Top