Nested else-if Statement

In this lesson, you will learn about the else-if statement in C++.

Introduction

Suppose you want to buy a present for your friend’s birthday. Below is a list of things, along with their costs, that you can buy for them:

Wrist-watch: $20

Comic book: $10

Chocolate: $5

Pen: $0

Get hands-on with 1400+ tech skills courses.