Posts by Mondial • 375 points
12 posts
-
2
votes1
answer1614
viewsQ: How to represent algorithm in C for Pseudocode?
I have the following code : setlocale(LC_ALL,"portuguese"); int numeros[5]; int media; for(int i = 0; i < 5; i++) { printf("Digite um número : "); scanf("%d", &numeros[i]); } media =…
-
5
votes1
answer483
viewsQ: How to correctly divide a number to only one digit in C?
I have the following function : divisibilidade11(int num); And the following variables: : int dividendo; int divisor; When the user enters with the type 11 for the variable divisor the function…
-
2
votes1
answer129
viewsQ: How to reuse a function correctly in C?
I have the following functions : int divisibilidade3(int num); int divisibilidade9(int num); int testarDivisibilidade(int dividendo, int divisor); With the function testarDivisibilidade I’ll test…
-
1
votes2
answers2428
viewsQ: How to use getche() with do-while in C?
I have the following variable : #include <stdio.h> #include <stdlib.h> #include <conio.h> char op; And I’m asking the user to enter a character : printf("\nDeseja realizar novo…
-
1
votes1
answer2117
viewsQ: How to correctly call a function through another function in C?
I have the following duties : int testarDivisibilidade(int dividendo, int divisor); int divisibilidade3(int num); And the following variables: : int dividendo; int divisor; With the function…
-
1
votes2
answers1005
viewsQ: How to get all the digits of a variable in C?
I have to do a function that tests divisibility by 3, return true if divisible by 3. Otherwise return false. Following the rule : A number is divisible by 3 when the sum of its digits is divisible…
-
1
votes1
answer3593
viewsQ: How to compare a string of an array in C?
I have the following variables : char nome[10][8]; int i; --> Sendo esta para o loop I ask the user to enter 5 names and then I read the variable : printf("Entre 5 nomes : \n"); for(i=0; i< 5…
-
2
votes1
answer10388
viewsQ: How to present only negative values in C?
I have three variables : int numero1,numero2,numero3; After you have declared them, I am asked the user to fill them in : printf("Digite o primeiro numero inteiro: "); scanf("%d", &numero1);…
-
2
votes1
answer193
viewsQ: How to present only even and odd values with three variables in C?
My variables are : int codigo; --> Sendo esta variável para o switch int numero1,numero2,numero3; User will enter with three variables : printf("Digite o primeiro numero inteiro: "); scanf("%d",…
-
6
votes1
answer7278
viewsQ: How to use the function toupper() in char in C?
I’m creating a variable: char nome[20]; After this, I am asking the user to enter a name: printf("Digite um nome : "); scanf("%20s",&nome); And I’m checking to see if the name is correct:…
-
5
votes2
answers1728
viewsQ: How to receive a string and switch to check in C?
I have to develop an algorithm that gets the name of a place, for example, "School", and based on this, do a check of the string in the switch, and if it is "School", then it sends a message to the…
-
2
votes1
answer1069
viewsQ: How to access variables from another class of objects per array?
I have two classes, : Route and Costs. Route : public double getKmPercorrida() { return kmPercorrida; } public void setKmPercorrida(double kmPercorrida) { this.kmPercorrida = kmPercorrida; } public…