На проблему указал @Weather Vane, я исправил ее, сделав другой массив и внеся в него изменения, вот код
#include <stdio.h>
#include <conio.h>
void table(){
printf("\n|-------------------------------------|");
printf("\n|variables|Minterms|Term|Maxterms|Term|");
printf("\n|---------|--------|----|--------|----|");
printf("\n| 0| 0 | 0|x'.y'.z'| m0 |x+y+z | M0 |");
printf("\n| 0| 0 | 1|x'.y'.z | m1 |x+y+z' | M1 |");
printf("\n| 0| 1 | 0|x'.y.z' | m2 |x+y'+z | M2 |");
printf("\n| 0| 1 | 1|x'.y.z | m3 |x+y'+z' | M3 |");
printf("\n| 1| 0 | 0|x.y'.z' | m4 |x'+y+z | M4 |");
printf("\n| 1| 0 | 1|x.y'.z | m5 |x'+y+z' | M5 |");
printf("\n| 1| 1 | 0|x.y.z' | m6 |x'+y'+z | M6 |");
printf("\n| 1| 1 | 1|x.y.z | m7 |x'+y'+z'| M7 |");
printf("\n|-------------------------------------|");
}
void main()
{ int i,j,k,n,nm,ochoice,minterms[10],kmap[4][4]={0,1,3,2,
4,5,7,6,
12,13,15,14,
8,9,11,10};
int k2map[4][4]={0,0,0,0,
0,0,0,0,
0,0,0,0,
0,0,0,0,};
char v[6];
printf("\t\t\tK-MAP");
printf("\n\t\t\t-----");
printf("\nEnter no of variables(3or4):");
scanf("%d",&n);
printf("\nEnter the variables: ");
for(i=0;i<n;i++)
{ printf("\nEnter variable %d: ",i+1);
scanf("%s",&v[i]);
}
printf("\n1.SOP");
printf("\n2.POS");
printf("\nEnter the required output form(1or2):-");
scanf("%d",&ochoice);
switch(ochoice)
{case 1 :{system("cls");
table();
printf("\nEnter the number of minterms : ");
scanf("%d",&nm);
printf("\nEnter the corresponding minterms number from the table above : ");
for(i=0;i<nm;i++)
{
printf("\nEnter Minterm %d:",i+1);
scanf("%d",&minterms[i]);
}
for(i=0;i<4;i++)
{
for(j=0;j<4;j++)
{
for(k=0;k<nm;k++){
if(kmap[i][j]==minterms[k]){
k2map[i][j]=1;
}
}
}
}
for(i=0;i<4;i++){
printf("\n");
for(j=0;j<4;j++){
printf(" %d ",k2map[i][j]);
}
}
break;
}
}
}