// Arup Guha
// 11/4/09
// Solution to COP 3223 Exam #2 Free Response Question #2: Product of Digits

#include <stdio.h>

int productdigits(int n); 

int main() {
    
    printf("Product of the digits in 16543 is %d\n", productdigits(16543));
    system("PAUSE");
    return 0;
}

int productdigits(int n) {
    int answer = 1;
    while (n > 0) {
        answer = answer*(n%10);
        n = n/10;
    }
    return answer;
}
