---
title: "Составить функцию, которая определяет, верно ли, что сумма его цифр – четное число."
description: "Пример: Введите число: 136 Сумма цифр четная. Введите число: 245 Сумма цифр нечетная. #inc..."
author: "dan_ntu"
published: "2014-12-04T01:46:03+00:00"
modified: "2014-12-04T01:46:03+00:00"
locale: "ru"
canonical_url: "https://yvision.kz/post/sostavit-funkciyu-kotoraya-opredelyaet-verno-li-chto-summa-ego-cifr-chetnoe-chislo-445370"
markdown_url: "https://yvision.kz/post/sostavit-funkciyu-kotoraya-opredelyaet-verno-li-chto-summa-ego-cifr-chetnoe-chislo-445370/markdown"
site_name: "Yvision.kz"
---

# Составить функцию, которая определяет, верно ли, что сумма его цифр – четное число.

> Пример: Введите число: 136 Сумма цифр четная. Введите число: 245 Сумма цифр нечетная. #inc...

Пример:

Введите число:

136

Сумма цифр четная.

Введите число:

245

Сумма цифр нечетная.

 
 
 

#include  #include  char* chet(int a){ int x1= a/100000; int x2=(a/10000)%10; int x3=(a/1000)%10; int x4=(a/100)%10; int x5=(a/10)%10; int x6=a%10; int s=x1+x2+x3+x4+x5+x6; char *str; if (s%2==0) str="Summa cifr chetnaya"; else str="Summa cifr ne chetnaya"; return str; } main(){ clrscr(); int n; printf("Vvedite chislo:\n"); scanf("%d",&n); printf(chet(n)); getch(); }

---

Source: [https://yvision.kz/post/sostavit-funkciyu-kotoraya-opredelyaet-verno-li-chto-summa-ego-cifr-chetnoe-chislo-445370](https://yvision.kz/post/sostavit-funkciyu-kotoraya-opredelyaet-verno-li-chto-summa-ego-cifr-chetnoe-chislo-445370)