Generation

generate functionSun, 30 Apr 2023

un programa que pida 5 números y cuente cuantos son positivos y negativos con do

#include <stdio.h> int main (){ int num, i, pos=0, neg=0; for(i=1;i<=5;i++){ printf("Introduce un numero:"); scanf("%d", &num); if (num>=0){ pos++; } else { neg++; } } printf("\nHay %d numeros positivos", pos); printf("\nHay %d numeros negativos", neg); return 0; }

Want to kickstart your project?Use the new AI Studio to create your code