online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
/* Original Matrix to Sparse Matrix*/ #include<stdio.h> #include<stdlib.h> void orgtosprs(int org[][20], int sparse[][3], int, int); void sparsetooriginal(int sp[][3],int org[][20]); int main() { int org[20][20], sparse[20][3]; int row, col, i, j; printf("\n\nEnter the Row and Column of the original matrix : "); scanf("%d %d", & row, & col); printf("\n\nEnter the values for original matrix : "); for (i = 0; i < row; i++) for (j = 0; j < col; j++) scanf("%d", & org[i][j]); orgtosprs(org, sparse, row, col); printf("\nAfter converting in Sparse Matrix : \n"); for (i = 0; i < sparse[0][2] + 1; i++) { for (j = 0; j < 3; j++) printf("%d\t", sparse[i][j]); printf("\n"); } printf("\nAfter converting back to Original from Sparse : \n"); sparsetooriginal(sparse,org); for(i=0; i<sparse[0][0]; i++) { for(j=0; j<sparse[0][1]; j++) printf("%d\t",org[i][j]); printf("\n"); } } void orgtosprs(int org[][20], int sparse[][3], int m, int n) { int t = 1, i, j; sparse[0][0] = m; sparse[0][1] = n; for (i = 0; i < m; i++) { for (j = 0; j < n; j++) { if (org[i][j] != 0) { sparse[t][0] = i; sparse[t][1] = j; sparse[t][2] = org[i][j]; t++; } } } sparse[0][2] = t - 1; } void sparsetooriginal(int sp[][3],int org[][20]) { int i,j,t; for(i=0; i<sp[0][0]; i++) for(j=0; j<sp[0][1]; j++) org[i][j]=0; for(i=1; i<=sp[0][2]; i++) { org[sp[i][0]][sp[i][1]]=sp[i][2]; } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue