Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Exercise 1:

#include <stdio.h>
int main()
{
float arr[10] = {0};
int dem = 0;
for(int i = 0; i < 7; i++)
{
scanf("%f",&arr[i]);
}
for(int j = 0; j < 7; j++)
{
if(arr[j] > 35)
{
dem += 1;
}
}
if(dem >= 4)
{
printf("1");
}
else
{
printf("0");
}
return 0;
}
Exercise 2:
#include <stdio.h>
int main()
{
int n, arr[100] = {0}, brr[100] = {0};
scanf("%d",&n);
for(int i = 0; i < n; i++)
{
scanf("%d",&arr[i]);
}
if(n <= 1)
{
printf("0");
return 0;
}
for(int j = 0; j < n-1; j++)
{
brr[j] = arr[j] * arr[j+1];
}
int max = brr[0];
for(int k = 0; k < n-1; k++)
{
if(brr[k] >= max)
{
max = brr[k];
}
}
printf("%d",max);
return 0;
}

You might also like