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: 276

.

+ 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

Nishat Mustafa, Mohsin Tahir, mahnoor and 3 more joined Virtual University of Pakistan
13 minutes ago
25 minutes ago
27 minutes ago
Aqsa Khan liked Alishba's discussion Nikkah Mubarak To <3 !! 'JS' !! <3
45 minutes ago
+!!!❣Stylo Queen❣!!!+ updated their profile
1 hour ago
+ ! Suspecious+ updated their profile
1 hour ago
+ ! Suspecious+ replied to + ! Suspecious+'s discussion احساسات
1 hour ago
+ ! ❤SΕNSΙТΙVΕ(∂ΕSΕЯТ ΡЯΙNCΕSS)❤ liked + ! Suspecious+'s discussion احساسات
1 hour ago
1 hour ago
1 hour ago

1

2

3