Исправить ошибки 'for' loop initial declarations are only allowed in C99 mode - C (СИ)
Формулировка задачи:
#include <stdio.h>
#include <conio.h>
#include <math.h>
#define N 10
#define M 5
int main(int argc, char* argv[])
{
float x[N] = {0} ;
for (int t1 == 0; t1 < N; t1++)
{
printf("x[%d] = ",t1); scanf("%f",&x[t1]);
}
printf("\n");
float a[M] = { 0 };
for (int t2 = 0; t2 < M; t2++)
{
printf("a[%d] = ",t2); scanf("%f",&a[t2]);
}
printf("\n");
for (int i = 0; i < M; i++)
for (int j = 0; j < N; j++)
if ((x[j] + abs(a[i])) == 15)
printf("a = %lf x = %lf f(x)=%lf\n",a[i],x[j],pow(x[j],2));
else if ((x[j] + abs(a[i])) < 15)
printf("a = %lf x = %lf f(x)=%lf\n",a[i],x[j],a[i] * 2);
else printf("a = %lf x = %lf f(x)=%lf\n",a[i],x[j],sqrt(a[i]));
_getch();
}Решение задачи: «Исправить ошибки 'for' loop initial declarations are only allowed in C99 mode»
textual
Листинг программы
for (int t1 = 0; t1 < N; t1++)