shadowws224 de Noviembre del 2009
Preguntadisculpen pero estoy aprendiendo a programar en c++, yo hize un programa para calcular el mayor de 2 numeros.. pero cuando lo corro el resultado siempre me da 0, podrian ayudarme? alli les dejo el programa
#include<stdio.h>
#include<conio.h>
int datos( int z );
int funcion( int x, int y);
int a,b ;
int main (){ // incio programa
datos (a);
datos (b);
funcion (a,b);
getche ();
} // fin programa
int funcion ( int x, int y) { // incio funcion
if (x > y) {
printf("el numero mayor es %d", x);
}else{
printf(" el numero mayor es %d", y );
}
} // fin funcion
int datos ( int z ) { // inicio funcion
printf("ingrese un numero: ");
scanf("%d", &z);
} // fin funcion
#include<stdio.h>
#include<conio.h>
int datos( int z );
int funcion( int x, int y);
int a,b ;
int main (){ // incio programa
datos (a);
datos (b);
funcion (a,b);
getche ();
} // fin programa
int funcion ( int x, int y) { // incio funcion
if (x > y) {
printf("el numero mayor es %d", x);
}else{
printf(" el numero mayor es %d", y );
}
} // fin funcion
int datos ( int z ) { // inicio funcion
printf("ingrese un numero: ");
scanf("%d", &z);
} // fin funcion
