ok guys wrote up some code but its not doing what i need it to do can i get help now?? and i use miracle c the compiler sucksssssssssss
Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main ()
{
int p,l;
float k,sum,sumad,total,*ptr;
int r[p];
printf("Please enter the number of ohms for %i resistors \n",p);
scanf(" %i",&p);
if ( p == 0)
{
printf("Please enter correct number of resistors, number must be higher then 0");
}
else
while (p >= 1)
{
int r[p];
for (l=1,l<=p,l++)
{
printf(" Resistor %i",l);
}
printf("\n\n Please enter each resistance in ohms %f",&ptr);
r = ptr;
sum *= r;
sumad += r;
total = sum/sumad;
printf("\n The total resistance for all ohms is %f .",total);
}
getch();
return 0;
}