I seem to have trouble reading the input from the array
#include <stdio.h>
#include <conio.h>
#define ROW 1
#define COL 6
void printinfo(int[][COL],int,int);
void findId(int[][COL],int,int);
int sum=0;
float avg=0;
int main()
{
int info[ROW][COL]={0};
for(int x=0;x<ROW;x++)
{
printf("\nEnter the students ID number:");
fflush(stdin);
scanf("%d",&info[x][0]);
for (int y=0;y<COL;y++)
{
printf("\nEnter the student grade:");
fflush(stdin);
scanf("%d",&info[x][y]);
}
}
printinfo(info,ROW,COL);
findId(info,ROW,COL);
getch();
return 0;
}
void printinfo(int a[][COL],int row,int col)
{
for(int y=0;y<row;y++)
{
printf("\nThe student ID number is:%d",a[y][0]);
for(int x=0;x<col;x++)
{
printf("\nThe student grades is:%d\n",a[y][x]);
sum+=a[row][col];
}
}
}
void findId(int a[][COL],int row,int col)
{
int num=0;
printf("\nPlease enter the student Id to be find:");
fflush(stdin);
scanf("%d",&num);
for(int y=0;y<row;y++)
{
printf("\nThe student ID number is:%d",num);
if(num==a[row][col])
{
printf("\nFound ID number");
break;
}
}
for (int x=0;x<col;x++)
printf("\nThe student grades are:%d",a[row][col]);
avg=sum/5;
printf("\nThe student average is:%f",avg);
}