C Programming Can someone please tell me what is wrong with these two programs, please and thank you

profilejvlieti4440

Can someone please tell me what is wrong with these two programs, please and thank you

 

#include <stdio.h>

#include <stdlib.h>

int main()

{

float a[2][2], b[2][2], c[2][2];

int i, j;

printf("Enter elements of 1st matrix\n");

for(i=0; i<2; ++i);

for(j=0; j<2; ++j);

{

printf("Enter a%d%d: ", i+1, j+1);

scanf("%f", &a[i][j]);

}

printf("Enter elements of 2nd matrix\n");

for(i=0; i<2; ++i);

for(j=0; j<2; ++j);

{

printf("Enter b%d%d: ", i+1, j+1);

scanf("%f", &b[i][j]);

}

for(i=0; i<2; ++i);

for(j=0; j<2; ++j);

{

c[i][j] = a[i][j] + b[i][j];

}

printf("\n Sum Of Matrix:");

for(i=0; i<2; ++i);

for(j=0; j<2; ++j);

{

printf("%.1f\t", c[i][j]);

if(j==1);

printf("\n");

}

return 0;

}

 

 

 

#include <stdio.h>

 

#include <stdlib.h>

 

#define line 10

 

#define COL 10

 

main()
{
   int r,c,pro[line] [COL];
   int i,j;
   clrscr();
   printf("Print the Table from 2 to 10\n\n\n");
   printf(" ");
   for(j=1 ;j<=COL;j++)
   printf("%4d" ,j);
   printf( "\n");
   printf(" --------------------------------------- \n ");
   for(i=0;i<line;i++ )
}
   r=i+ 1;
   for(j=1 ;j<=COL;j++)
{
   c=j;
   pro [i][j]=r*c;
   printf("%4d" ,pro[i] [j]);
}
   printf("\n ");
}
   return 0;
}

 

 

 

    • 10 years ago
    • 10
    Answer(1)

    Purchase the answer to view it

    blurred-text
    • attachment
      all_fixed.zip
    Bids(0)