maybe this should go inthe help section .........
i am a n00b to coding..........i started 2 days ago can anyone tell me wats wrong with this code......i am using C++ and a win32 console???...... there are 4 errors in this can anyone spot them....i cant
// EX1_01.CPP
// A Simple Program
#include <iostream>
using namespace std;
int main()
{
int apples, oranges, peaches, tomatos; // Declare 4 integer variables
int fruit; // ...then another one
int veges; // ... then another one
apples = 5; oranges = 6; peaches = 7; tomatos = 5; // Set initial values
fruit = apples + oranges + peaches; // Get the total fruit
veges = tomatos; // Get the total veges
cout << endl; // Start output on a new line
cout << "oranges are not the only fruit... " <<endl
<< "- and we have " << fruit << " fruits in all."<<endl
<< apples << " apples " << oranges << " oranges " << peaches << " peaches "endl
<< "BUT we will have " << apples + oranges + peaches + tomatos << " If we add veges "endl
<< "because we have " << tomatos << " tomatos ";
cout << endl; // Start output on a new line
return 0; // Exit the program
}
------------------------------------------------
thanx
i am a n00b to coding..........i started 2 days ago can anyone tell me wats wrong with this code......i am using C++ and a win32 console???...... there are 4 errors in this can anyone spot them....i cant
// EX1_01.CPP
// A Simple Program
#include <iostream>
using namespace std;
int main()
{
int apples, oranges, peaches, tomatos; // Declare 4 integer variables
int fruit; // ...then another one
int veges; // ... then another one
apples = 5; oranges = 6; peaches = 7; tomatos = 5; // Set initial values
fruit = apples + oranges + peaches; // Get the total fruit
veges = tomatos; // Get the total veges
cout << endl; // Start output on a new line
cout << "oranges are not the only fruit... " <<endl
<< "- and we have " << fruit << " fruits in all."<<endl
<< apples << " apples " << oranges << " oranges " << peaches << " peaches "endl
<< "BUT we will have " << apples + oranges + peaches + tomatos << " If we add veges "endl
<< "because we have " << tomatos << " tomatos ";
cout << endl; // Start output on a new line
return 0; // Exit the program
}
------------------------------------------------
thanx