/* Genera 20 aleatorios del 1 al 9 y nos dice cuantos pares diferentes a 4 se generaron */
#include
#include
#include
main()
{
int i,x,cuenta=0,par=0;
clrscr();
randomize();
for (i=1;i<=20;i++)
{
x=random(9) +1;
printf("%d ",x);
if (x%2==0) /* Si son pares */
par=par+1;
if (x==4)
cuenta=cuenta+1;
}
par=par-cuenta;
printf("\nSe generaron %d pares diferentes a 4",par);
getch();
}
One of the most astonishing old town on the planet Old City of Jerusalem
-
Jerusalem is perhaps the most established city on the planet . By measuring
its history and its multifaceted nature, on the off chance that we think
about ...
Hace 5 años
0 comentarios:
Publicar un comentario