C - Write program to display the first and last names of the first four presidents of the United States

Requirements

Write a program that displays the first and last names of the first four presidents of the United States.

Store the names in a multidimensional char array.

Demo

#include <stdio.h>

int main()/*from   ww w .  j  ava  2s  .co  m*/
{
    char pres[4][2][11] = {
        "George", "Washington",
        "John", "Adams",
        "Thomas", "Jefferson",
        "James", "Monroe"
    };
    int loop;

    for(loop=0;loop<4;loop++)
        printf("%-6s %-10s\n",pres[loop][0],pres[loop][1]);

    return(0);
}

Result