#include <stdio.h>

int main()
{
    printf ("Introduce un número: ");
    int n;
    scanf ("%d", &n);
    printf ("%d\n", n);
    int resto;
    int contador=0;
    printf ("Los números impares son: ");
    for (int i=1; i<=n; i+=2)
        {
            printf ("%d ", i);
            contador+=1;
        }
    printf ("\n");
    printf ("Total de números impares: %d\n", contador);
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: