i am a beginner in programming in C++. In my class we were recently showed to use functions and parameters. We were left an assignment where we are supposed to work with functions, except the only problem is i can't seem to get a start. I have wrote two functions so far. My main function, which asks for input from the user. Also another function which uses this input to create a new integer i will later need. I'm sure there are several mistakes in my code, but right now i really only need to know why only my main function will execute. I have been looking for hours, and switching stuff around, just to get another function other than the main to run, but my it will only run the main function and then the program will end. After inputting data from the user, the program will end. I haven't been able to get any other function to run other than the main, since i started this assignment. I am using visual studio 2017. Sorry for the trouble.
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int digits(int zip);
int main() {
int zip = 0;
cout << "Enter zipcode: ";
cin >> zip;
return 0;
}
int digits(int zip){
int d5 = int();
d5 = zip % 10;
cout << "test: " << d5 << endl;
return d5;
}