1. Scanf 5 names of you and your friends

2. Printf hi to all of them.
3. Ask all of them for their ages.
4. Printf the information in tables as shown below.

Name age
StudName1 19
StudName2 20
StudName3 18
StudName4 34
StudName5 12

5. Use selection statement to do the following, when the user press 1, show the information of the first person, press 2, for second person and so on until the 5th person

To implement the given task, you can use a combination of C programming language and basic input/output functions. Here's the step-by-step guide on how to achieve it:

1. First, declare an array to store the names of the friends and initialize it with a size of 5. You can do this using the following code:

```c
char names[5][50]; // assuming maximum name length is 50 characters
```

2. Use a loop to prompt the user to enter the names of the friends and store them in the array. You can achieve this with the help of the `scanf` function. Here's an example of how to accomplish this:

```c
printf("Enter the names of you and your friends:\n");

for (int i = 0; i < 5; i++) {
printf("Friend %d: ", i + 1);
scanf("%s", names[i]);
}
```

3. After storing the names, you can use another loop to greet each friend individually. For this, you can utilize the `printf` function. Here's an example of how to accomplish this:

```c
printf("Greetings to all of your friends:\n");

for (int i = 0; i < 5; i++) {
printf("Hi, %s!\n", names[i]);
}
```

4. Next, prompt the user to enter the ages of each friend. Store the ages in an array of integers, similar to how you stored the names. Here's an example:

```c
int ages[5];

printf("Enter the ages of your friends:\n");

for (int i = 0; i < 5; i++) {
printf("%s: ", names[i]);
scanf("%d", &ages[i]);
}
```

5. Finally, you can print the name and age information in tabular format using a loop and `printf` function. Here's an example:

```c
printf("Name\t\tage\n");

for (int i = 0; i < 5; i++) {
printf("%s\t\t%d\n", names[i], ages[i]);
}
```

6. To implement the selection statement and display the information of a specific person based on user input, you can use an `if` statement or a `switch` statement. Here's a simple example using the `switch` statement:

```c
printf("Enter a number (1-5) to view the information of a person: ");
int choice;
scanf("%d", &choice);

switch (choice) {
case 1:
printf("Name: %s\nAge: %d\n", names[0], ages[0]);
break;
case 2:
printf("Name: %s\nAge: %d\n", names[1], ages[1]);
break;
case 3:
printf("Name: %s\nAge: %d\n", names[2], ages[2]);
break;
case 4:
printf("Name: %s\nAge: %d\n", names[3], ages[3]);
break;
case 5:
printf("Name: %s\nAge: %d\n", names[4], ages[4]);
break;
default:
printf("Invalid choice!\n");
}
```

That's it! Following these steps will allow you to scan the names of your friends, greet them, ask for their ages, display the information in a table, and use a selection statement to show the information of a specific person based on user input.