SlideShare una empresa de Scribd logo
1 de 32
Descargar para leer sin conexión
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

Más contenido relacionado

Más de Emertxe Information Technologies Pvt Ltd

Más de 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
 

Último

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 

Último (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 

06_sort_names.pdf