lunes, 22 de septiembre de 2008

funciones y procedimientos

ESTE ES UNA FUNCION DE LA SUMA

void main sumar();
main()
{
sumar();
getch();
}

void sumar()
int a,b
{
pritf("pon un numero");
s canf("%d",&a)
pritf("dame otro numero");
scanf("%d",&b);
pritf("la suma9%d"a+b);
}

ESTE ES UN PROCEDIMIENTO QUE RESTA
int restar();
main()
{
int r;r=restar();
printf("la resta es%d",r);
getch();
}
int restar ()
{
int a,b;
printf("dime un numero");
scanf("%d",&a);

printf("dame otro numero");
scanf("%d",&b);
returm a-b;
}
haslo esta facil

No hay comentarios: