Posts by João Gabriel de Castro Almeida • 37 points
5 posts
-
0
votes2
answers1482
viewsA: How can I complete the harmonic mean?
#include <stdio.h> main() { double a,i,s,media; s=1; i=0; media=0; while (s==1) { i=i+1; a=0; //Condição inserida para o usuario não digitar 0. while…
-
0
votes2
answers6127
viewsA: Code for calculating the first N primes in C?
Code to perform a primes search in a user-determined range. #include <stdio.h> main() { int a,b,f,i,r,min,max,z; printf("Digite dois valores para ser calculado os numeros primos dentro do…
canswered João Gabriel de Castro Almeida 37 -
1
votes3
answers18598
viewsA: How to find the rest of the division?
#include <stdio.h> main() { int a,b; printf("Digite o valor do dividendo: "); scanf("%d",&a); printf("Digite o valor do divisor: "); scanf("%d",&b); while(a>=b) a=a-b;…
-
2
votes3
answers4910
viewsA: Split result equals zero in decimals
#include <stdio.h> int main(){ float numero,a,b; a=1; b=3; numero = a/b; printf("o valor do numero e':%.2f \n\n",numero); return 0; } …
-
-1
votes8
answers59138
viewsA: How to raise a number to a power without using the Math. h library?
I imagine it goes something like this: #include <stdio.h> main(){ int b,c,d,n,x,y,z; double p; printf("Lembrando que: base ^ (numerador/denominador) = potencia\n\n"); //Linha opcional…