prueba de anoche programacion

7 views
Skip to first unread message

luis rastagena

unread,
Jun 13, 2014, 2:37:22 PM6/13/14
to Grupo de clase
Yo hice una muletilla en los switchs, ya que no recordaba como retornarlo al menú jaja 

parenle bolas a las clases, o cómanse un mamey..

#include<stdio.h> 
#include<conio.h> 
#define y 11

void vec() 
int x[y],i,j,aux;
 
//Ingreso de valores
for (i=0; i <y; i++) 
printf("De valor de x[%d]:", i+1); 
scanf("%d",&x[i]); 
    }

for (i=0; i <y; i++) 
for (j=0; j <y; j++) 

if ( x[i] > x[j] ) 
aux= x[i]; x[i]=x[j];x[j]=aux; 
for(i=0; i <y; i++) 

printf("\n los numoros son x[i]: %i=\t%i",i, x[i] ); getch(); 

void mensaje()
{
printf("\n \t salida del sistema\n");getch(); 
}

main()
{
int opc;
l:printf("\n bienvenido al sistema, elija una opc:\t");
printf("\n 1... burbuja de vector   (1)\t");
printf("\n 2... salida del sistema  (2)\t");
scanf("%i",&opc);
switch(opc)
{
case 1:
vec();getch;goto l;break;
case 2:
mensaje();getch;break;
default:
printf("\nerror de opc, elije otra\t");getch;goto l;break;
}
getch();return 0;
}


--
Gracias
Saludos
Reply all
Reply to author
Forward
0 new messages