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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started