InformáticaBásico1 respuestas

Leer 500 números enteros y obtener cuantos de ellos son positivos?

Leer 500 números enteros y obtener cuantos de ellos son positivos. PORFAVOR PASEN ESA TAREA EN LENGUAJE C.

Mejor respuesta

10

Código en Dev c + + - - - - - - - - - - - - - - - - - - - - - - - - - - -

#include

#include

int main(){

int i, x, cant ;

cant = 0 ;

for(i = 1 ; i0){ cant = cant + 1 ; }

} printf(" \ nSon positivos : %i \ n", cant) ;

return 0 ;

} / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / Codigo alternativo

#include

#include

int main(){ int i, x, cant, n ; cant = 0 ; printf("Ingresar una cantidad : ") ; scanf("%d", &n) ; for(i = 1 ; i0){ cant = cant + 1 ; } } printf(" \ nSon positivos : %i \ n", cant) ;

return 0 ;

}

Saludos.