c++

1 answers

Error executing in Visual Studio 2008

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

Read more »
Created by Anonymous 18 weeks 1 day ago
  Tags:
1 answers

I have a Linux file descriptor (from socket), and I want to read one line. How to do it in C++?

15 points

I have a Linux file descriptor (from socket), and I want to read one line at a time. How to do it in C++?

Read more »
Created by ranipoojax 45 weeks 5 days ago
  Tags: