SlideShare a Scribd company logo
Team Emertxe
Advanced Pointers,Arrays and
Functions
Assignment 6
Assignment 6
Assignment 6
Read n & n person names of maxlen 20. Sort and print the
names
Assignment 6
Read n & n person names of maxlen 20. Sort and print the
names
Input:
Assignment 6
Read n & n person names of maxlen 20. Sort and print the
names
Input: Read n value and n person names
Assignment 6
Read n & n person names of maxlen 20. Sort and print the
names
Input: Read n value and n person names
Output:
Assignment 6
Read n & n person names of maxlen 20. Sort and print the
names
Input: Read n value and n person names
Output: Sort the names and print
Examples:-
Assignment 6
Examples:-
 Read the rows/names(N). Assume N = 3
 Rows are dynamic.
 Columns/Characters are static to 20.
Assignment 6
Examples:-
 Read the rows/names(N). Assume N = 3
 Rows are dynamic.
 Columns/Characters are static to 20.
Assignment 6
1000
2000
3000
500
504
508
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Examples:-
 Read the 3 names.
 [0] -> Arunachal
 [1] -> Bengaluru
 [2] -> Agra
Assignment 6
Examples:-
Assignment 6
1000
2000
3000
500
504
508
A r u n a c h a l 0
B e n g a l u r u 0
A g r a 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Examples:-
 Compare each characters starting from the 1st row.
 Compare using strcmp function(Don’t use built in)
 In strcmp function,
• If 1st character of string 1 == 1st character of string 2,
-> Move to the next character.
• If 1st character of string 1 > 1st character of string 2,
-> Swap the strings.
• If 1st character of string 1 < 1st character of string 2,
-> Don’t swap.
Assignment 6
Examples:-
 Comparing ‘A’ from Arunachal and ‘B’ from Bengaluru
 ‘A’ < ‘B’, so don’t swap.
Assignment 6
1000
2000
3000
500
504
508
A r u n a c h a l 0
B e n g a l u r u 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
A g r a 0
Examples:-
 Comparing ‘B’ from Bengaluru and ‘A’ from Agra.
 ‘B’ > ‘A’, so swap the strings.
Assignment 6
1000
2000
3000
500
504
508
A r u n a c h a l 0
B e n g a l u r u 0
A g r a 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Examples:-
 Comparing ‘B’ from Bengaluru and ‘A’ from Agra.
 ‘B’ > ‘A’, so swap the strings.
Assignment 6
1000
3000
2000
500
504
508
A r u n a c h a l 0
A g r a 0
B e n g a l u r u 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Examples:-
 Comparing ‘B’ from Bengaluru and ‘A’ from Agra.
 ‘B’ > ‘A’, so swap the strings.
Assignment 6
1000
3000
2000
500
504
508
A r u n a c h a l 0
A g r a 0
B e n g a l u r u 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Examples:-
 Comparing ‘A’ from Arunachal and ‘A’ from Agra.
 ‘A’ = ‘A’, so compare the next character.
Assignment 6
1000
3000
2000
500
504
508
A r u n a c h a l 0
A g r a 0
B e n g a l u r u 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Examples:-
 Comparing ‘r’ from Arunachal and ‘g’ from Agra.
 ‘r’ > ‘g’, so swap the strings.
Assignment 6
1000
3000
2000
500
504
508
A r u n a c h a l 0
A g r a 0
B e n g a l u r u 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Examples:-
 Comparing ‘r’ from Arunachal and ‘g’ from Agra.
 ‘r’ > ‘g’, so swap the strings.
Assignment 6
3000
1000
2000
500
504
508
A g r a 0
A r u n a c h a l 0
B e n g a l u r u 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Examples:-
 Comparing ‘A’ from Arunachal and ‘B’ from Bengaluru.
 ‘A’ < ‘B’, so don’t swap.
Assignment 6
3000
1000
2000
500
504
508
A g r a 0
A r u n a c h a l 0
B e n g a l u r u 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Examples:-
 This is the sorted order of names.
Assignment 6
3000
1000
2000
500
504
508
A g r a 0
A r u n a c h a l 0
B e n g a l u r u 0
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Sample execution:-
Assignment 6
Sample execution:-
Assignment 6
Assignment 6
Pre-requisites:-
Assignment 6
Pre-requisites:-
⮚ Functions
Assignment 6
Pre-requisites:-
⮚ Functions
⮚ Dynamic Arrays
Assignment 6
Pre-requisites:-
⮚ Functions
⮚ Dynamic Arrays
⮚ Pointers
Assignment 6
Pre-requisites:-
⮚ Functions
⮚ Dynamic Arrays
⮚ Pointers
Objective:-
Assignment 6
Pre-requisites:-
⮚ Functions
⮚ Dynamic Arrays
⮚ Pointers
Objective:-
⮚ To understand the concept of Functions ,Arrays and Pointers
Team Emertxe
Thank you

More Related Content

More from Emertxe Information Technologies Pvt Ltd

04_magic_square.pdf
04_magic_square.pdf04_magic_square.pdf
03_endianess.pdf
03_endianess.pdf03_endianess.pdf
02_variance.pdf
02_variance.pdf02_variance.pdf
01_memory_manager.pdf
01_memory_manager.pdf01_memory_manager.pdf
09_nrps.pdf
09_nrps.pdf09_nrps.pdf
11_pangram.pdf
11_pangram.pdf11_pangram.pdf
10_combinations.pdf
10_combinations.pdf10_combinations.pdf
08_squeeze.pdf
08_squeeze.pdf08_squeeze.pdf
07_strtok.pdf
07_strtok.pdf07_strtok.pdf
06_reverserec.pdf
06_reverserec.pdf06_reverserec.pdf
05_reverseiter.pdf
05_reverseiter.pdf05_reverseiter.pdf
04_itoa.pdf
04_itoa.pdf04_itoa.pdf
03_atoi.pdf
03_atoi.pdf03_atoi.pdf
02_getword.pdf
02_getword.pdf02_getword.pdf
01_Removeblanks.pdf
01_Removeblanks.pdf01_Removeblanks.pdf
01_wordcount.pdf
01_wordcount.pdf01_wordcount.pdf
19_sorted_order.pdf
19_sorted_order.pdf19_sorted_order.pdf
18_negative_fibonacci.pdf
18_negative_fibonacci.pdf18_negative_fibonacci.pdf
18_negative_fibonacci.pdf
Emertxe Information Technologies Pvt Ltd
 
17_positive_fibonacci.pdf
17_positive_fibonacci.pdf17_positive_fibonacci.pdf
17_positive_fibonacci.pdf
Emertxe Information Technologies Pvt Ltd
 
16_factorial.pdf
16_factorial.pdf16_factorial.pdf

More from Emertxe Information Technologies Pvt Ltd (20)

04_magic_square.pdf
04_magic_square.pdf04_magic_square.pdf
04_magic_square.pdf
 
03_endianess.pdf
03_endianess.pdf03_endianess.pdf
03_endianess.pdf
 
02_variance.pdf
02_variance.pdf02_variance.pdf
02_variance.pdf
 
01_memory_manager.pdf
01_memory_manager.pdf01_memory_manager.pdf
01_memory_manager.pdf
 
09_nrps.pdf
09_nrps.pdf09_nrps.pdf
09_nrps.pdf
 
11_pangram.pdf
11_pangram.pdf11_pangram.pdf
11_pangram.pdf
 
10_combinations.pdf
10_combinations.pdf10_combinations.pdf
10_combinations.pdf
 
08_squeeze.pdf
08_squeeze.pdf08_squeeze.pdf
08_squeeze.pdf
 
07_strtok.pdf
07_strtok.pdf07_strtok.pdf
07_strtok.pdf
 
06_reverserec.pdf
06_reverserec.pdf06_reverserec.pdf
06_reverserec.pdf
 
05_reverseiter.pdf
05_reverseiter.pdf05_reverseiter.pdf
05_reverseiter.pdf
 
04_itoa.pdf
04_itoa.pdf04_itoa.pdf
04_itoa.pdf
 
03_atoi.pdf
03_atoi.pdf03_atoi.pdf
03_atoi.pdf
 
02_getword.pdf
02_getword.pdf02_getword.pdf
02_getword.pdf
 
01_Removeblanks.pdf
01_Removeblanks.pdf01_Removeblanks.pdf
01_Removeblanks.pdf
 
01_wordcount.pdf
01_wordcount.pdf01_wordcount.pdf
01_wordcount.pdf
 
19_sorted_order.pdf
19_sorted_order.pdf19_sorted_order.pdf
19_sorted_order.pdf
 
18_negative_fibonacci.pdf
18_negative_fibonacci.pdf18_negative_fibonacci.pdf
18_negative_fibonacci.pdf
 
17_positive_fibonacci.pdf
17_positive_fibonacci.pdf17_positive_fibonacci.pdf
17_positive_fibonacci.pdf
 
16_factorial.pdf
16_factorial.pdf16_factorial.pdf
16_factorial.pdf
 

Recently uploaded

Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
christianmathematics
 

Recently uploaded (20)

Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
What is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptxWhat is the purpose of studying mathematics.pptx
What is the purpose of studying mathematics.pptx
 

06_sort_names.pdf