InfLab1/prog3.c

18 lines
542 B
C
Raw Normal View History

2024-11-30 12:44:57 +04:00
#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);
}