c - Error expected ')' before 'R' -
estoy usando lenguaje c . composicion de funciones
esta es mi primer funcion ( function 1 )
int volumencilindro (int y, int h) { int volumencilindro = ( pow (y,2)* 3.14 * h ); return volumencilindro; } y esta es la segunda funcion ( , second function )
int volumencilindrohueco (int r, int r, int h) { int volumencilindrohueco = (volumencilindro r h) - (volumencilindro r h); return volumencilindrohueco ; } int main () { int r; int r; int h; int volumencilindrohueco = (r,r,h); printf (" calcular el volumen del cilindro hueco..."); printf ( " ingrese el radio del cilindro mayor... %d",r ); printf ( " ingrese el radio del cilindro menor ...%d",r ); printf ( " ingrese la altura de ambos cilindros ... %d",h); volumencilindrohueco = (r,r,h); printf ( " el resultado es ... %d",volumencilindrohueco ); system("pause"); return 0; } and error
error expected ')' before 'r' gracias por su ayuda , soy nuevo en este lenguaje y no podido empezar en el tema de composicion de funciones. gracias
this
(volumencilindro r h) - (volumencilindro r h)should replaced by
volumencilindro (r, h) - volumencilindro (r, h)this
int volumencilindrohueco = (r,r,h);should replaced by
int volumencilindrohueco1;and this
volumencilindrohueco = (r,r,h);should replaced by
volumencilindrohueco1 = volumencilindrohueco(r,r,h);you need change
volumencilindrohuecovolumencilindrohueco1in followingprintf().in
main(),r,r,huninitialized, may needscanf(" %d", &r);initialize them. therefore, thisprintf ( " ingrese el radio del cilindro mayor... %d",r );should replaced by
printf ( " ingrese el radio del cilindro mayor... "); scanf (" %d", &r);
Comments
Post a Comment