Re: [Dev-C++] cpp freshman trying to write program
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: PETER C. <nuc...@ms...> - 2004-06-20 04:05:40
|
thanx for responding...
here is what i have. i declared sum in int. i do not understand why sum = a
+b +c does not work.
i also tried declraring the variables as double.
the program runs but when adding 3+3+3 i get 3 million.
#include <iostream>
#include <iomanip>
using namespace std;
int main(){
int a,b,c, sum;
cout << "Input three different integers: " << endl;
cin >> a,b,c;
sum = a+ b+ c;
cout << "the sum is: " << sum << endl;
return 0;
}
>From: Per Westermark <pw...@ia...>
>To: PETER CAMPOS <nuc...@ms...>
>CC: dev...@li...
>Subject: Re: [Dev-C++] cpp freshman trying to write program
>Date: Sun, 20 Jun 2004 01:17:11 +0200 (CEST)
>
>Sorry, but we need more information about what you are trying to
>accomplish. Just adding three numbers ins't so much of a problem :)
>
>#include <iostream>
>
>using std::cout;
>
>int main() {
> int a = 10;
> int b = 20;
> int c = 30;
> cout << "The sum is: " << a+b+c << "\n";
> return 0;
>}
>
>On Sat, 19 Jun 2004, PETER CAMPOS wrote:
>
> > trying to do simple numerical operators....+ - / *
> > want to add three numbers
> > been at this all day and i can't figure it out..
> >
> > help me out please
> > peter--nyc
> >
> > _________________________________________________________________
> > Get fast, reliable Internet access with MSN 9 Dial-up now 3 months
>FREE!
> > http://join.msn.click-url.com/go/onm00200361ave/direct/01/
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> > Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> > Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> > REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
>Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
>Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
>REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
|