Posts by Luciano Balestrin Correa • 71 points
10 posts
-
2
votes1
answer102
viewsQ: Memory allocation for string array with malloc()
This code below asks for a num for the amount of strings I want to store in vetor which in this case is the pointer char *strings[num]. #include <stdlib.h> #include <stdio.h> int main()…
-
0
votes0
answers11
viewsQ: How to read a TXT file when instantiating an object?
At the moment of instantiating an object I need to go through parâmetro a directory with a file . txt and read the same. It would be something like this: Texto t1 = new…
javaasked Luciano Balestrin Correa 71 -
0
votes1
answer35
viewsQ: Factorial calculation without finishing the program
How would I make this algorithm not to terminate the program and allow me to write other numbers to calculate the factorial? I’ve tried putting one while, or do while, but in no way works, because…
-
0
votes1
answer267
viewsQ: Exercise with counter problem
The exercise needs to be done with while or while, in C language.. A city hall conducted a survey among its inhabitants, collecting data on salary and number of children. The city hall wishes to…
casked Luciano Balestrin Correa 71 -
0
votes2
answers42
viewsQ: Miscalculation with While
In this exercise it is to type two numbers and print on the screen themselves, and the integers between them. However, if I type for example 10 and 20, the last number that appears is 19 instead of…
-
1
votes3
answers89
viewsQ: Wrong calculation of percentage
How exactly is it made to use the switch correctly? Here in the code, the case 1 and 2, they function normally, but in case 3 and 4, at the time of division by 2, or by 3, to know the plots, always…
-
0
votes1
answer123
viewsQ: Ideal Weight Exercise (Language C)
Would anyone like to explain to me how I could be part of the "situation" in this exercise? how would I represent this in the algorithm? just need to finish, the rest works.. #include…
casked Luciano Balestrin Correa 71 -
0
votes2
answers169
viewsQ: Read multiple values and average
In this algorithm if I write 10, 10 and then -1 to shut down he calculates 9.5. No division gives exactly the result it should be, or is it my algorithm that is spelled wrong? That would be the…
casked Luciano Balestrin Correa 71 -
0
votes2
answers603
viewsQ: While or Do While exercise using CHAR variable
Good evening guys! and the following.. I need to do this exercise here while in C: e) In a presidential election there are 2 candidates. Votes are informed through codes. For candidate 1 the code is…
casked Luciano Balestrin Correa 71 -
-1
votes2
answers57
viewsQ: Track data count shows wrong result
A city hall conducted a survey among its inhabitants, collecting data on the population’s salary. The city wants to know: a) Number of people with a salary higher than R $ 2000,00.Number of people…