Two Dimensional Array

PHOTO EMBED

Wed Mar 06 2024 02:39:42 GMT+0000 (Coordinated Universal Time)

Saved by @kervinandy123 #c

main()
{
  int num[3][4];
  int i. j;
  int total=0, average=0;
  
  printf("Enter 12 numbers:");
  for(i=0; i<=2; i++)
    for(j=0; j<=3; j++)
      {
      scanf("%d", &num[i][j]);
 		 total=total+num[i][j];
      }
  average=total/12;
  
  //display the content of the array
  for(i=0; i<=2; i++)
    for(j=0; j<=3; j++)
      printf("%d", num[i][j]);
  printf("\n");
  
  //display odd numbers
  printf("The odd numbers are:")
  for(i=0; i<=2; i++)
    {
    for(j=0; j<=3; j++)
      if(num[i][j]%2==1)
        printf("%d", num[i][j]);
    }
  
}
content_copyCOPY