Untitled

 avatar
unknown
plain_text
3 years ago
981 B
4
Indexable
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>

int main()
{
    int j, i, disp[2][3];

    for(i = 0; i < 2; i++){
       for(j = 0; j < 3; j++){
       printf("Enter a value for disp[%d][%d]: ", i, j);
       scanf("%d", &disp[i][j]);
       }
    }
    
    printf("Two dimensional array elements:\n");

    for(i = 0; i < 2; i++){
       for(j = 0; j < 3; j++){
       printf("%d", disp[i][j]);
       if(j < 2){
        printf(", ");
       }
       if(j == 2){
        printf("\n");
       }
       }
    }

    return 0;
}
Editor is loading...