Passwords Activity Solution

#include <cs50.h>
#include <stdio.h>

// make a promise to the compiler that the def of lucky will follow
void firstpart();
void secondpart();
void lastbit();
void lucky();

int main(int argc, string argv[])
{
   printf("What’s the password?\n");
   firstPart();
   secondPart();
   printf("\n");
}

void firstPart() {
   printf("1");
   lastBit();
}

void secondPart() {
   printf("8");
   firstPart();
   lucky();
   lastBit();
}

void lastBit() {
   printf("3");
   lucky();
   printf("4");
}

void lucky() {
   printf("7");
}