forked from Userslav/uchebabezhalostna1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamEx3.c
More file actions
28 lines (24 loc) · 777 Bytes
/
examEx3.c
File metadata and controls
28 lines (24 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
int a[10]; // объявлен массив a из 10 элементов
int i;
int MULT = 1;
// Ввод элементов массива
for (i = 0; i<10; i++)
{
printf("a[%d] = ", i);
scanf("%d", &a[i]); // &a[i] - адрес i-го элемента массива
}
// Вывод элементов массива
for (i = 0; i<10; i++)
printf("%d ", a[i]); // пробел в формате печати обязателен
getchar(); getchar();
for (i = 0; i < 10; i++) {
if(i % 2 == 0)
MULT = MULT * a[i];
}
printf("Multiplication = %d", MULT);
return 0;
}