Preview:
include <stdio.h> 

  

int main() 

{ 

    int array[3][4]; 

    int r, c, total, smallest, largest; 

    float ave; 

     

    printf ("Enter 12 Integers: "); 

     

    //input Integers 

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

        for (c=0;c<=3;c++) { 

         scanf ("%d", &array[r][c]);    

        } 

     

    //print 12 Integers 

    printf ("The numbers inputted are: "); 

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

        for (c=0;c<=3;c++) { 

         printf ("%d ", array[r][c]);    

        } 

     

    //print 12 Integers 

    printf ("\nThe numbers in reverse are: "); 

    for (r=2;r>=0;r--) 

        for (c=3;c>=0;c--) { 

         printf ("%d ", array[r][c]);    

        } 

     

    //odd 

    printf ("\nThe odd numbers are: "); 

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

        for (c=0;c<=3;c++) { 

         if (array[r][c]%2==1) 

         printf ("%d ", array[r][c]);    

        } 

     

    //even 

    printf ("\nThe even numbers are: "); 

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

        for (c=0;c<=3;c++) { 

         if (array[r][c]%2==0) 

         printf ("%d ", array[r][c]);    

        } 

     

    //total 

    printf ("\nSum: "); 

    for (r=0;r<=2;r++) { 

        for (c=0;c<=3;c++) { 

        total=total+array[r][c]; 

        } 

    }   

    printf ("%d", total); 

     

    //average 

    printf ("\nAverage: "); 

    ave=total/12; 

    printf ("%.2f", ave); 

     

    smallest = largest = array[0][0]; 

     

    //Smallest and largest 

    for (int r=0;r<=2;r++) { 

        for (c=0;c<=3;c++) { 

         if (array[r][c]<smallest) { 

            smallest = array[r][c]; 

         } 

        if (array[r][c]>largest) { 

            largest = array[r][c]; 

         } 

        }} 

         

    printf ("\nThe smallest is: %d", smallest); 

    printf ("\nThe largest is: %d", largest); 

     

    //nalito ako sa number 8 kasi two dimensional toh pero sige 

    float a2[3][4]; 

     

    printf ("\nThe 2nd array contains: "); 

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

        for (c=0;c<=3;c++) { 

         

        a2[r][c]=array[r][c]; 

        printf ("%.0f ", a2[r][c]); 

         

        } 

    return 0; 

}   

 
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter