Listing 4 Indexes a string literal

/* array4.c: Indexing a string literal */

#include <stdio.h>

main()
{
    int i;
    
    for (i = 0; i < 10; i +=2)
    {
       char c = "0123456789"[i];
       putchar(c);
    }
    putchar('\n');
    return 0;
}

/* Output
02468
*/

/* End of File */