Predict the output for the C++ program in Program Q2. 8. 10. Program Q2 1. int age; 2. if(age>12) 3. { 4. if(age<=18) 5.
Posted: Wed Apr 27, 2022 5:03 pm
Predict the output for the C++ program in Program Q2. 8. 10. Program Q2 1. int age; 2. if(age>12) 3. { 4. if(age<=18) 5. { 6. cout<< "Category D”; 7. } else 9. { cout<<< "Category C"; 11. } 12. } 13. else 14. { if (age > 2) 16. { 17. cout<<< "Category B"; 18. } 19. else 20. { 21. cout << "Category A”; 22. } 23. } 15. W Answer Age Output 27 13 8 2 12.7