Errors in C++

#include<iostream>
using namespace std;
void main(){
int qty;
int sp;
double sv;
double disc;
double netsv;
cout<<"please enter quantity"<<endl;
cin>>qty;
cout<<"please enter selling price"<<endl;
cin>>sp;
sv=sp*qty;
if(sv>1000){
disc=sv*0.1;
}else{
disc=0;
}
netsv=sv-disc;
cout<<"net price:"<<netsv<<endl;
}



After compile this program i have got 0 errors. But i cant execute this program using Visual studio 2008 . But i can execute this program using visual studio 2005. what is the wrong with this program. why i cant execute this program in visual studio 2008.

I have got these errors when i execute the program using VS 2008
Linking...
2.obj : error LNK2005: _main already defined in 1.obj
3.obj : error LNK2005: _main already defined in 1.obj
D:\cpp 2008\C class lessons\Debug\C class lessons.exe : fatal error LNK1169:
one or more multiply defined symbols found
there are 2 more definition of main in your project.
Do you have only one source code in your project ? Only this one ?
Also use int main()...
you have to click on "Build" from menu and then click on "Clean Solution"... after that recompile
Topic archived. No new replies allowed.