18 lines
542 B
C
18 lines
542 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "progs.h"
|
|
|
|
void prog3(){
|
|
int input, mul;
|
|
printf("Программа выводит произведение цифр трёхзначного числа.\n Введите данные.\n");
|
|
printf("Число: "); scanf("%d", &input);
|
|
|
|
if(input < 100 || input > 999){
|
|
printf("Ошибка: введено недопустимое число\n");
|
|
exit(1);
|
|
}
|
|
|
|
mul = input%10*(input/10)%10*(input/100)%10;
|
|
printf("Произведение цифр числа равно %d\n", mul);
|
|
}
|