Почему переменная t
выводит на экран не то?
#include <stdio.h>
#include <math.h>
int a[7];
void vvoda(){
puts("Puts values for a array");
for(int i = 0; i < 7; i++)
scanf("%i", &a[i]);
}
void suma(){
int t;
for(int i = 0; i < 7; i++){
t += a[i];
t = t/7;
printf("%i\n", &t);
}
printf("Average of a array is %i", &t);
}
main(void){
vvoda();
suma();
}
Вот что выдает консоль:
Puts values for a array 4 5 45 4 54 5 4 2293272 2293272 2293272 2293272 2293272 2293272 2293272 2293272 Average of a array is 2293272 -------------------------------- Proccess exited after 2.143 seconds with return value 0 Для продолжения нажмите любую клавишу . . .
&
передt
?