Error executing in Visual Studio 2008

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


12 points

The following program runs fine on Visual Studio 2005 and gives me 0 Errors when I compile it. It is not executing on Visual Studio 2008. What could be the reason?

#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;
}



0 points

trying using int (main)

should help!

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.