0% found this document useful (0 votes)
301 views1 page

Cheat Sheet Editor For Exams - Create Your Cheat Sheets For Exams For Free

The document provides a C program that converts a given matrix into a sparse matrix format, displaying non-zero elements along with their row and column indices. It includes functions for inputting the matrix dimensions and values, and for processing the matrix to output the sparse representation. Additionally, it features an online cheat sheet editor for exam preparation, allowing users to create and customize their notes.

Uploaded by

dhanushk20044002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
301 views1 page

Cheat Sheet Editor For Exams - Create Your Cheat Sheets For Exams For Free

The document provides a C program that converts a given matrix into a sparse matrix format, displaying non-zero elements along with their row and column indices. It includes functions for inputting the matrix dimensions and values, and for processing the matrix to output the sparse representation. Additionally, it features an online cheat sheet editor for exam preparation, allowing users to create and customize their notes.

Uploaded by

dhanushk20044002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Preview Cheat Sheet

HIDE
Cheat Sheet Editor #include <stdio.h>
#define MAX 10
void convertToSparse(int matrix[MAX][MAX], int row, int col) {

Online Cheating notes editor for exams


int sparse[MAX * MAX][3];
int k = 0;
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
if (matrix[i][j] != 0) {
sparse[k][0] = i;
sparse[k][1] = j;

Start writing your exam cheat sheet in the editor below


sparse[k][2] = matrix[i][j];
k++;
}
}

Pick the font size and the line height. Letter 5 is recommended for }
printf("\nSparse Matrix (Row Col Value):\n");

exams
for (int i = 0; i < k; i++) {
printf("%d %d %d\n", sparse[i][0], sparse[i][1], sparse[i][2]);
}

Resize the exam cheat sheet by grabbing and moving the bottom right
}
int main() {
int matrix[MAX][MAX];

holder of the cheat sheet preview at the right side int row, col;
printf("Enter rows and columns: ");

Add more cheat sheets by pressing (+)


scanf("%d %d", &row, &col);
printf("Enter matrix values:\n");
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
scanf("%d", &matrix[i][j]);
}
}
convertToSparse(matrix, row, col);
return 0;
}

#include <stdio.h>

#define MAX 10

void convertToSparse(int matrix[MAX][MAX], int row, int col) {


int sparse[MAX * MAX][3];
int k = 0;

for (int i = 0; i < row; i++) {


for (int j = 0; j < col; j++) {
if (matrix[i][j] != 0) {
sparse[k][0] = i;
sparse[k][1] = j;
sparse[k][2] = matrix[i][j];
k++;
}
}
}

printf("\nSparse Matrix (Row Col Value):\n");


for (int i = 0; i < k; i++) {
printf("%d %d %d\n", sparse[i][0], sparse[i][1], sparse[i][2]);
}
}

int main() {
int matrix[MAX][MAX];
int row, col;

printf("Enter rows and columns: ");


scanf("%d %d", &row, &col);

printf("Enter matrix values:\n");


for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
scanf("%d", &matrix[i][j]);
}
}

convertToSparse(matrix, row, col);

return 0;
}

Print Cheat Sheet

🙊
Discover the new hidden camera for exams Monorean Cam:

You might also like