This repository contains solutions to selected exercises from Chapter 3: Functions and References of the book
📘 "Object-Oriented Programming in C++" by Robert Lafore.
| Exercise No. | Description |
|---|---|
| Exercise 1 | Basic function to display a line |
| Exercise 2 | Function to display multiple lines |
| Exercise 4 | Function to convert inches to feet |
| Exercise 5 | Return-by-value in temperature conversion |
| Exercise 6 | Use of global variables in functions |
| Exercise 7 | Function returning larger of two numbers |
| Exercise 8 | Demonstrating function prototypes |
| Exercise 12 | Using function overloading |
📌 All code is written in standard C++ and can be compiled using any modern compiler like
g++,clang++, or MSVC.
To compile and run an example (e.g., exercise1.cpp), use the following command:
g++ exercise1.cpp -o exercise1
./exercise1robert-lafore-cpp-chapter3/
├── exercise1.cpp
├── exercise2.cpp
├── exercise4.cpp
├── exercise5.cpp
├── exercise6.cpp
├── exercise7.cpp
├── exercise8.cpp
├── exercise12.cpp
└── README.md
This book is a classic for beginners to intermediate programmers looking to master object-oriented concepts through C++. Chapter 3 focuses on:
- Function declaration & definition
- Return values
- Parameter passing
- Overloading and more
Tanzeela Fatima 📍 Kotli AJK 🔗 GitHub Profile 📧 [email protected]
Feel free to fork or star the repo if you find it helpful!