Could somebody kindly show me how to make a C coding using a 2-d array that display output like this: Name....Age ..A.........8 ..B........10
#include<stdio.h> #include<conio.h> void main() { int arr[26][2],i,j,n=8,c=65; clrscr(); printf("Name..................Age"); for(i=0;i<26;i++) { for(j=0;j<1;j++) { printf("%c\t%d",n,c); } n=n+2; c=c+1; printf("\n"); } getch(); }
Below given example is the 2-D array with output. Code: #include <stdio.h> #include <conio.h> void main() { int a[3][3], i, j; clrscr(); printf("\n\t Enter matrix of 3*3 : "); for(i=0; i<3; i++) { for(j=0; j<3; j++) { scanf("%d",&a[i][j]); //read 3*3 array } } printf("\n\t Matrix is : \n"); for(i=0; i<3; i++) { for(j=0; j<3; j++) { printf("\t %d",a[i][j]); //print 3*3 array } printf("\n"); } getch(); } Output: Enter matrix of 3*3: 3 4 5 6 7 2 1 2 3 Matrix is: 3 4 5 6 7 2 1 2 3_