Skip to content

Commit 4adf7dd

Browse files
authored
Update sortcom.cpp
1 parent 130b8c5 commit 4adf7dd

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

sorting/sort_strings/sortcom.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,20 @@ bool alpha_comp(char *s1,char *s2)
4040
{
4141
return (strcmp(s1,s2)<0)?true:false;
4242
}
43+
44+
45+
// Input:
46+
//sorts these string values
47+
// string names1[] = {"George","Penny","Estelle","Don","Mike","Bob"};
48+
//converts these inches to centimetres
49+
// double inches[] = {3.5,6.4,6,7,8};
50+
51+
// Output:
52+
// 8.89 16.256 15.24 17.78 20.32 5.34025e-317 22.5806
53+
// Don is element 3 on the list
54+
// Bob
55+
// Don
56+
// Estelle
57+
// George
58+
// Mike
59+
// Penny

0 commit comments

Comments
 (0)