We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

# Compiler error.need help.

#include <iostream.h>
main()
{
int age1,age2,age3,age4,age5,age6;
int TotalAge;
int AverageAge;
cout "Enter the age 1:";
cin >> age1;

cout "Enter the age 2:";
cin >> age2;

cout "Enter the age 3:";
cin >> age3;

cout "Enter the age 4:";
cin >> age4;

cout "Enter the age 5:";
cin >> age5;

cout "Enter the age 6:";
cin >> age6;

TotalAge=age1+age2+age3+age4+age5+age6;

cout "Average Age of the class is:";
AverageAge=totalage/6;

}

Compiler error says that total age not declared.

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 316

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

### Replies to This Discussion

You right totalage in last line. See above you declare TotalAge

thnx

try initializing variable TotalAge & AverageAge like

int TotalAge = 0;

int AverageAge =0;

//Also include <\< after every cout statement and correct line

TotalAge = age1+age2+age3+age3+age4+age5+age6!
to
TotalAge = age1+age2+age3+age3+age4+age5+age6;

thnx

Sorry write

C++ is case senstive language totalage NOT EQUAL TO TotalAge, you declared variable TotalAge and using as totalage which is error

thanks for help :)

## Latest Activity

7 hours ago
VU Student posted a discussion

### Soultion for this Assignment please!!!!

7 hours ago
8 hours ago
8 hours ago
8 hours ago
maheen mahan posted a discussion

### https://youtu.be/G5lZCFrVV6o

9 hours ago
Mushk replied to muhammad salman khan's discussion Mother
9 hours ago
Mushk liked muhammad salman khan's discussion Mother
9 hours ago
Somaya commented on + Ḱẚảḿḯ's blog post No Title
9 hours ago
muhammad salman khan posted a discussion

### Mother

10 hours ago
muhammad salman khan posted a status
10 hours ago
Mushk replied to Mushk's discussion * * YAhi Behtar Hai * *
10 hours ago

1

2

3