Posts by user32333 • 145 points
4 posts
-
6
votes2
answers1608
viewsQ: Infinite loop trying to calculate if the number is prime
I have no idea how I’m going to determine the condition of for for prime numbers. I always end in looping. #include <stdio.h> int main() { int num = 1, primo; do { printf("Informe um numero…
-
3
votes1
answer127
viewsQ: Repeat commands to restrict a valid value
I need a code that reads a number greater than 1, and if a number less than or equal to zero is entered, another number is requested, and therefore can be tested if true. I wanted help to complete…
-
2
votes2
answers72
viewsQ: Code compilation
Guys help me, I can’t compile this code: Until starts the command screen no more runs #include <stdio.h> int main() { int x,y,z; int a=0; for (x=0;x<=1;x=x+1) for(y=x;y<=1;y=y+1)…
-
3
votes1
answer223
viewsQ: How does this code restrict entry to a number between 0 and 4?
I was answering this question, but it doesn’t make sense to me. For me I would have to relate values less than 0 and greater than 4. I understood that I understood the inverse of alternative C.…