Undeclared Identifier Problems

So I'm writing this very simple program and I'm just starting with C++. I have no idea how to fix these errors and I searched all over the net. I think these problems are very individual, so I'm posting mine here.

1
2
3
4
5
6
7
8
9
10
#include <iostream> 
int main(){ 

	float numberOfStudents = 6; 
	float classSize = 30;

	float percentInvolved = (numberOfStudents / classSize) * 100; 
	cout << "The percentage of students involved in the fight is:" <<percentInvolved << "%" << endl;
	return 0;
}   

The errors are the words cout and endl are undeclared identifiers.
1
2
    // The identifiers cout and endl reside in the std namespace.
    std::cout << "The percentage of students involved in the fight is:" <<percentInvolved << "%" << std::endl;
Omg, thank you. I forgot to add using namespace std; Thanks for the quick reply.
Last edited on
Topic archived. No new replies allowed.