Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

Specifer



Comment



Test expression



Iterative statement



" ; " after loop




Array 2_D - read and display ( 2 * 2 ) matrix




// AHF C PROGRAM SOLVING

//solving here 2_D   ARRAY 	programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { int marks[2][2],i,j; // declaring a two dimensional array pf("\nEnter a 2x2 matrix: "); for(i=0;i < 2;i++) for(j=0;j < 2;j++) scanf("%d",&marks[i][j]); pf("\nThe given matrix is: "); for(i=0;i < 2;i++) { pf("\n"); for(j=0;j < 2;j++) pf("%d\t",marks[i][j]); } return 0; }
OUTPUT:


© 2018 - All rights reserved