Untitled
unknown
plain_text
a month ago
430 B
1
Indexable
Never
// Online C compiler to run C program online #include <stdio.h> void main() { int arr[4][4]={{1,0,0,3},{2,0,7,0},{3,4,0,0},{3,0,0,0}}; int tri[100][3]; int k=0; for(int i=0;i<4;i++){ for(int j=0;j<4;j++){ if (arr[i][j]!=0){ k++; tri[k][0]=i; tri[k][1]=j; tri[k][2]=arr[i][j]; } } } tri[0][0]=4; tri[0][1]=4; tri[0][2]=k; }
Leave a Comment