Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- int lowestIndex, highestValue, total, choice, n, sortedArray[12];
- lowestIndex = 0;
- printf("Select a Road User\n");
- printf("1)Pedestrian\n2)Motor Cyclists\n3)Motor Car\n4)Light Truck\n5)Truck\n");
- scanf_s(" %d", &choice);
- if (choice == 1)
- {
- total=12;
- highestValue = Pedestrian[0];
- while (lowestIndex < total)
- {
- for (n = lowestIndex; n < 12; n++)
- {
- if (Pedestrian[n] > highestValue)
- {
- highestValue = Pedestrian[n];
- sortedArray[n] = highestValue;
- }
- }
- lowestIndex++;
- }
- printf("The highest to lowest number of injuries is %d for Pedestrians", sortedArray[n]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment