#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#define size 15
int mass[size];
void randArray()
{
printf("An array of the fiveteen random elements:\n");
for (int i=0; i<size; i++)
mass[i] = 1 + rand() % 100;
printf("%d\t", mass[i]);
}
int findElements(unsigned count)
count = 0;
if (abs(mass[i]) % 10 == 6) count++;
return count;
int main()
unsigned count = 0;
srand(time(NULL));
randArray();
printf("\nNumber of elements which ending on six: %d", findElements(count));
return 0;
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#define size 15
int mass[size];
void randArray()
{
printf("An array of the fiveteen random elements:\n");
for (int i=0; i<size; i++)
{
mass[i] = 1 + rand() % 100;
printf("%d\t", mass[i]);
}
}
int findElements(unsigned count)
{
count = 0;
for (int i=0; i<size; i++)
{
if (abs(mass[i]) % 10 == 6) count++;
}
return count;
}
int main()
{
unsigned count = 0;
srand(time(NULL));
randArray();
printf("\nNumber of elements which ending on six: %d", findElements(count));
return 0;
}