Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » General Discussions » General Discussion » I Learn Some Basic C++!
Re: I Learn Some Basic C++! [message #391996 is a reply to message #391988] Tue, 23 June 2009 17:00 Go to previous messageGo to previous message
nopol10 is currently offline  nopol10
Messages: 1043
Registered: February 2005
Location: Singapore
Karma:
General (1 Star)
SSnipe wrote on Wed, 24 June 2009 06:48

as i said im new and this basic stuff is all i know so far but im just guessing it but here cnc

#include "stdafx.h"
#include <iostream>
using namespace std;

int main() {
	double a, b, c, d, e;
	cout << "Enter numbers here to be added up (5 is the max) then multiplied by 100 ";
	    cin >> a;
	cout << "Enter second digits: ";
		cin >> b;
	cout << "Enter third digits: ";
		cin >> c;
	cout << "Enter fourth digits ";
		cin >> d;
	cout << "Enter fifth digits: ";
		cin >> e;
    cout << "The Output Is: " << 100 * a + b + c + d + e;
	return 0;
}




Order of operations, what happens here is that a is multiplied by 100 and then added together with b, c, d and e. What you need is to bracket up a+b+c+d+e.
cout << "The Output Is: " << 100 * (a + b + c + d + e);




nopol10=Nopol=nopol(GSA)

http://i14.photobucket.com/albums/a330/napalmic/siggy.jpg
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Your daily commute to work!
Next Topic: Virus
Goto Forum:
  


Current Time: Thu Nov 28 22:04:36 MST 2024

Total time taken to generate the page: 0.01133 seconds