undeclared identifier

Hi..I've just started to learn programming with c++.I wrote my program in Dev C++ and when I compiled it, this error message showed:

In function 'int main():'
'number_of_pods' undeclared(first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
'o' undeclared(first use this function)

Can somebody help me with this?Maybe I just missed typing out something or the code was wrong in the first place..These are the codes by the way:


#include <iostream>
using namespace std;

int main()
{
int number_of_pea_pods, peas_per_pod, total_peas;

cout<<"Press return after entering a number.\n";
cout<<"Enter the number of pods:\n";
cin>>number_of_pods;
cout<<"Enter the number of peas in a pod:\n";
cin>>peas_per_pod;

total_peas = number_of_pods*peas_per_pod;
cout<<"If you have";
cout<<number_of_pods;
cout<<"pea pods\n";
cout<<"and";
cout<<peas_per_pod;
cout<<"peas in each pod, than\n";
cout<<"you have";
cout<<total_peas;
cout<<"peas in all the pods.\n";

return 0;
}

I'd really appreciate your help..thanks!
The variable you declared is called 'number_of_pea_pods', not 'number_of_pods'.
thanks helios..I did not see that part..
Topic archived. No new replies allowed.