Question: C PROGRAM NEED SAME OUTPUT PLZ DONOT GIVE WRONG O/P 1 - Read n & n person names of maxlen 20. Sort and print the

C PROGRAM NEED SAME OUTPUT PLZ DONOT GIVE WRONG O/P

1 - Read n & n person names of maxlen 20. Sort and print the names

Description:

Read the N name from the user

Sort it in alphabetical order

Use 1st dynamic and 2nd static. Char (*name)[20]

No.of names should be dynamic and no.of characters should be static.

Allocate the memory dynamically for no.of names.

Pr-requisites:-

Functions

Dynamic Arrays

Pointers

Objective: -

To understand the concept of

Functions, Arrays, and Pointers

Inputs: -

Array on N names, N

Sample execution: - Test Case 1: user@emertxe] ./sort

Enter the size: 5

Enter the 5 names of length max 20 characters in each [0] -> Delhi [1] -> Agra [2] -> Kolkata [3] -> Bengaluru [4] -> Chennai

The sorted names are: Agra Bengaluru Chennai Delhi Kolkata

requested file

#include

void sort_names(char (*)[20], int);

int main() { __fpurge(stdout); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!