-1
I would like to print one vector[300] and another [500], but in a way it seems to be, for the user, an array... for example, I did one of [100], where I made the loop to print this vector and an "if" for him to break the line so that when he arrived at divisible values by 10 he would perform it as said.
for(l=0;l<100;l++){
if(l%10==0) // if de quebra de linha
printf("\n");
if(vetorCEM[l]==0)
printf("[%2d]-",l+1);
the second if is just to show the explicit content of my vector, but what I want to highlight is this example I used, but for the 300 and 500 did not succeed, I wish someone could help me, plisss!!
yes, I did the 100 in this theory of 10x10, and I imagined the 300, which in a matrix would be 15x20, and the 500 20x25... for the 300 I put %15=0, it even worked but until a certain amount of the vector, the same way happened in the 500, that I used %20==0... the intention was not really to print a "perfect matrix", but rather to break the lines in these parameters according to how far the looping goes
– ViniSRB
@Vinisrb But 15x20 does not form a square, and the same for 20x25. Wanting a matrix of 300 elements to be shown as a perfect square is not possible as explained in this answer, because 10x10 gives 100 but there is no integer multiplied by it itself gives 300. Now if what you want is a rapprochement then you should make that clear in the question too.
– Isac