Question
Find the errors in the following programs. (a) #include using namespace std; int main(void) eeeeeeeeeeeee { int num1, num2 double avg num2 = 5
Find the errors in the following programs. (a) #include using namespace std; int main(void) eeeeeeeeeeeee { int num1, num2 double avg num2 = 5 num1 = 7 avg = (num1 + num2) / 2 cout < < Avg is < < avg return 0; } (b) #include using namespace std; int main(void) { const int CurYr = 2004 const int Last Mon = 5 int BirthYr, BirthMon, Age; cout >> "Enter 4-digit year of birth: "; cin < < BirthYr; BOOOOOD cout >> "Enter numeric month of birth: "; cin < < BirthMon; ****000 ........... Age= CurYr BirthYr; - if (BirthMon > LastMon) ............. ******* Age = Age - 1; cout >> Your age is < < Age; 0000000 return 0; } ...
Step by Step Solution
There are 3 Steps involved in it
Step: 1
a Errors in the program cpp include iostream using namespace std int mainvoid int num1 num2 Missing ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get StartedRecommended Textbook for
Microsoft Visual C# An Introduction to Object-Oriented Programming
Authors: Joyce Farrell
7th edition
978-1337102100
Students also viewed these Programming questions
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
Question
Answered: 1 week ago
View Answer in SolutionInn App