C Program To Reverse An Array Using For Loop
♣ Try it Out ::
#include<stdio.h> #include<conio.h> main() { int Arr[101], Num, i; printf("How many numbers you wish to input in array: "); scanf("%d", &Num); printf("Enter %d Integers:\n", Num); for(i=0; i<Num; i++) scanf("%d", &Arr[i]); printf("\nReverse Array is:\n"); for(i=Num-1; i>=0; i--) printf("%d ", Arr[i]); getch(); return(0); }
♣ Output ::
How many numbers you wish to input in array: 5 Enter 5 Integers: 8 4 2 0 3 Reverse Array is: 3 0 2 4 8
♣ Downloads ::
Comments
Post a Comment