Find and Replace elements in Matrix in c programming | by Sanjay Gupta

preview_player
Показать описание
Find Here: Links of All C language Video's Playlists/Video Series
C Interview Questions & Answers | Video Series

for | while | do-while loops in c | Video Series

Functions in C | Video Series

Graphics in C | Video Series

1-D Array | 2-D Array | String | Pointer | Function | File Handling in C

Structure & Union in C | Video Series

String in C | Video Series

1-D Array in C | Video Series

2-Array in C | Video Series

C Preprocessor | Video Series

File Handling in C | Video Series

Pointer in C | Video Series

Dynamic Memory Allocation in C | Video Series

Pattern Programs in C | Video Series

Recursion in C | Video Series

#cprogramming #ctutorials #clanguage
Рекомендации по теме
Комментарии
Автор

thank you very much for the explanation brother 👌👌👌

sandysandilya
Автор

why is there n1 and n2 i didnot get it can any one help me

gamingwithbiswash
Автор

So what if you want the matrix to automatically print array elements to 0: arr[i][j] = 0.
Then use values, n1, n2 to replace them after?

#include <stdio.h>
int main(){
int i, j, n_i, n_j, n_n;
int arr[9][9];

//for each element, print '0'
//pass a value into a single element
printf("Element i: ");
scanf("%d", &n_i);
printf("\nElement j: ");
scanf("%d", &n_j);
printf("\nWhat number to replace element [i][j]?: ");
scanf("%d", &n_n);

for(i = 0; i < 9; i++){
for(j = 0; j < 9; j++){
printf(" %d", arr[i][j] = 0);
if(arr[i][j] == arr[n_i][n_j]){

arr[i][j] = n_n;
}
}
printf("\n");
}

return 0;
}

tile-maker