Posts by Matheus Santos • 41 points
12 posts
-
-1
votes1
answer58
viewsQ: Problem with Fibonacci Sequence Calculation
I am doing an exercise that is to return the Fibonacci Sequence in C language up to a certain number informed by the user. The problem is that the program instead of calculating up to that number,…
casked Matheus Santos 41 -
0
votes1
answer50
viewsQ: Array size set by variable
I checked and I see no mistakes. void exibe (int * , int); int main(){ int n; int m[n], i; printf("Digite o numero de elementos do array : "); scanf("%d",&n); for (i = 0; i < n; i++){…
-
0
votes0
answers18
viewsQ: Doubt using C Pointers
I wonder if there is any difference using %d instead of %p to return the pointers address. Using the %d operator is good programming practice? int a, *aPtr; aPtr = &a; printf("Digite o valor de…
casked Matheus Santos 41 -
0
votes1
answer22
viewsQ: Problem in queries N : N
I wonder why I can not search a query in tables that have the relationship N to N. I need to search the name of the product, the name of its manufacturer, the name and email of its suppliers, only…
-
0
votes1
answer48
viewsQ: Code does not display result
My code receives as input the value of n, i and j and calculates the n first multiples of i and j. I’ve gone through my loop loop and I can’t find anything wrong, but the compiler just stands still…
-
0
votes3
answers58
viewsA: The result comes out another
This variable calculation is not necessary, because the condition to calculate the excess is when the weight exceeds 50 kg. float peso, multa; printf("Digite quantos quilos voce coletou: \n");…
-
0
votes0
answers62
viewsQ: Problem reading a C string
I would like to know why my programme does not accept reading the name of the second and third students at all. I’ve already used the buffer clean command, which is fflush(stdin) and he hasn’t done…
casked Matheus Santos 41 -
-1
votes1
answer1242
viewsQ: Smallest value typed in a vector
I wonder why my code is returning the wrong value of the smallest variable : int i, numero[10], menor; menor = numero[0]; for (i = 1; i <= 5; i++){ printf("Entre com o %d numero : \n",i);…
casked Matheus Santos 41 -
-1
votes2
answers699
viewsQ: Multiples of 2 numbers in C
I am doing a program in C that asks for the value of n and two positive integers i and j. With these values I have to calculate n natural numbers that are multiples of i or j and or both. But my…
casked Matheus Santos 41 -
-1
votes2
answers398
viewsQ: Multiple of a number in C
i am making an algorithm that finds the first multiple of 11, 13 or 17, but I don’t know how I show only the first multiple within a loop of repetition. int numero; printf("Digite um numero : ");…
casked Matheus Santos 41 -
1
votes1
answer356
viewsQ: Store random numbers in a variable in C
Hello, I need to compare the random value of 2 dice thrown, and I would like to know how I can store the result of these numbers in the variables D1 and D2. int d1, d2, n; printf("Quantas vezes voce…
casked Matheus Santos 41 -
1
votes1
answer39
viewsQ: Error in meter division
Why is my code performing the wrong average division because of the variable contador? int numero,contador, soma; float media; soma = 0; for (contador = 1; contador <= 3; contador++) {…