given 2 dimension array
Question compared 2 array , printfCode:int a[2][2]={1,1}, {2,2}; int b[2][2]={2,1}, {1,2}; int percentage;
how many % are match ?
given 2 dimension array
Question compared 2 array , printfCode:int a[2][2]={1,1}, {2,2}; int b[2][2]={2,1}, {1,2}; int percentage;
how many % are match ?
I don't understand the question.
Code:while(!asleep) { sheep++; }
mean 1st array is
second arrayCode:A[2][2] {x,x} {x,x} // random input by user
printf (array a only match array b by xx% please retry to get correct 1)Code:B [2][2]{2,1}, {1,2}//target by system
my question is how to calculate the percent?
Percentage = (number of interesting items) / (total number of items) * 100
In your example, the number of interesting items is 2, the total number of items is 4 ... so the percentage is 2 / 4 * 100 = 50