reverse list in C

[ad_1]

reverse list in C
#include 

void main() {
	int List[5] = { 1, 2, 3, 4, 5 };
	int starting_index = 0;
	int end_index = 4;

	while (starting_index < end_index) {
		int temp = List[starting_index];
		List[starting_index] = List[end_index];
		List[end_index] = temp;
		starting_index += 1;
		end_index -= 1;
	}
	for (int i = 0; i < 5; i++) {
		printf(
	}

}

[ad_2]

Please follow and like us:
Content Protection by DMCA.com