Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

intage1 was not declared in this scope C++

#include <iostream>
using namespace std;
int main ()
{
	intage1,intage2;
	intage1 = 18;
	intage2 = 15;
	int TotalAge;
	int AverageAge;
	cout << "Please enter the sge of student 1:";
	cin >> age1;
	cout << "Please enter the age of student 2:";
	cin >> age2;
	Totalage = age1 + age2;
	AverageAge = Totalage / 2;
	cout << "The averageage of the class:";
	<< AverageAge;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #declared #scope
ADD COMMENT
Topic
Name
6+2 =