hi all,
im new to programming in general and im probably asking something very simple here.....
well i have a 2d symmetric array where i search for a value and if found i want to give the value of zero to the whole row
here what i have managed until now:
Code:
#include "stdafx.h"
#include<stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
int array1[3][3]={{ 0,113,303},
{113, 0,196},
{303,196, 0}};
int i;
int j;
for(i=0;i<=2;i++){
for (j=0;j<=2;j++){
/* check if number 113 exists */
if(array1[i][j]==113){
/*if yes make it zero*/
array1[i][j]=0;
/*also, make the values for row i =0*/
}
printf("%2d ",array1[i][j]);
}
printf("\n");
}
scanf("%d",&i);
return 0;
}