COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
birthday.cpp
Go to the documentation of this file.
1
#include <iostream>
2
using namespace
std;
3
4
// ### Implement birthday() here ###
5
void
birthday
(
int
& b){
6
// pass by reference
7
// int& b vs int &b <-- no difference
8
b++;
9
}
10
11
// ###
12
13
int
main
(){
14
int
myAge;
15
cin >> myAge;
16
birthday
(myAge);
17
cout <<
"My age after birthday is "
<< myAge;
18
}
birthday
void birthday(int &b)
Definition
birthday.cpp:5
main
int main()
Definition
birthday.cpp:13
Module5
birthday.cpp
Generated on Sun Sep 29 2024 16:39:53 for COMP2113 by
1.12.0