Untitled

 avatar
unknown
plain_text
2 years ago
351 B
5
Indexable
int main(){
	
	int num;
	int cantImpares= 0;
	int total= 0;
	float res = 0;
	
while(num != 0){
		printf("Ingrese un numero entero:\n" );
	scanf("%d", &num);
	total++;
	
	if(num % 2 != 0){
		cantImpares++;
}
	}


res = cantImpares*100 /total;

printf("El porcentaje de numeros impares es de %f" ,res);
	
	getchar();
	return 0;
}
Editor is loading...