this is my program about a 2D array. It should show the output MENU with the
following choices: A.INSERT B.PRINT C. SEARCH D. EXIT.
it still got errors.
main()
{
int array[10][10]={};
int rows;
int cols;
int i,j,search;
char A,B,C={'A','B','C'};
printf("MENU\n");
printf("A. INSERT\n\nB. PRINT\n\nC. SEARCH\n\nD. EXIT\n\n");}
if(A==A);
{scanf("Enter the number of rows:," &rows")";
scanf("Enter the number of columns:," &cols")";
for(i=0; i<rows; i++){
for(j=0; j<cols; j++){
scanf("Enter a number," &array[rows][cols]")";
}}
}
else if(B==B);
{ for(i=0; i<rows; i++){
for(j=0; j<cols; j++)
printf("%d\t,"array[rows][cols]);
}}
else if(C==C);
{scanf("Enter the number you want to find:," &search")";
for(i=0; i<rows; i++){
for(j=0; j<cols; j++){
if(search==array[rows][cols]);{
printf("The element %d is on
(%d,%d),"search, rows, cols);}
else
{printf("The element is not
found.");
}}}
}
else{};
return 0;
}