Answers for "How will you read input at location (i, j) of a 2D array using pointer to pointer, assume the name of the pointer to pointer variable as arr? write the appropriate scanf statement"

C
0

how to get input in 2d array in c

#include <stdio.h>

int main(){

    printf("Enter the number of columns");
    int i; 
    scanf("%d", &i);
    printf("Enter the number of rows");
    int y; 
    scanf("%d", &y);

    int r[i][y];
    int a;
    int b;

        for (a=0; a<i; a++){
            for (b=0; b<y; b++){
    scanf("%d",&r[a][b]);
        }
    }
}
Posted by: Guest on November-19-2020

Code answers related to "How will you read input at location (i, j) of a 2D array using pointer to pointer, assume the name of the pointer to pointer variable as arr? write the appropriate scanf statement"

Code answers related to "C"

Browse Popular Code Answers by Language