Задача 1.
#include
int main()
{
unsigned x, y = 5;
printf("Enter number: ");
scanf("%u", &x);
for (unsigned i = 0; i < x; i++)
{
printf("%u ", y);
y *= 3;
}
}
Задача 2.
#include
int main()
{
unsigned n, sum = 0;
printf("Enter number: ");
scanf("%u", &n);
for (unsigned i = 1; i <= n; i += 2)</p>
{
sum += i;
}
printf("%u\n", sum);
}
Задача 3.
#include
int main()
{
unsigned n, compos = 1;
printf("Enter number: ");
scanf("%u", &n);
for (unsigned i = 1; i <= n; i += 2)</p>
{
compos *= i;
}
printf("%u\n", compos);
}
Задача 4.
#include
int main()
{
unsigned sum = 0, num = -1;
do {
scanf("%u", &num);
if (num % 2 == 0 && num % 10 == 6) {
sum += num;
}
} while (num != 0);
printf("Sum = %u\n", sum);
}