Skip to content

Instantly share code, notes, and snippets.

@yesidays
Created July 16, 2012 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yesidays/3121763 to your computer and use it in GitHub Desktop.
Save yesidays/3121763 to your computer and use it in GitHub Desktop.
Dividiendo arreglo de flotantes
#include <stdio.h>
int main() {
float total[5] = { 1.5, 2.4, 2.1 };
float totalAux[5];
float resultado;
int divide = 0;
printf("Ingresa el número entre cual dividiras tus datos: ");
scanf("%d", &divide);
for(int i=0;i<=3;i++){
resultado = total[i] / divide;
totalAux[i] = resultado;
printf("%f \n", totalAux[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment