Computer Science, asked by rbrohan6837, 11 months ago

Q basic program to print the elements of array in reverse order

Answers

Answered by aryan12326
0

Answer:

PROGRAM:

  • #include <stdio. h>
  • int main()
  • {
  • //Initialize array.
  • int arr[] = {1, 2, 3, 4, 5};
  • //Calculate length of array arr.
  • int length = sizeof(arr)/sizeof(arr[0]);
  • printf("Original array: \n
Answered by unknownRU
0

Hope it helps!

Mark me as Brainlist!

Reverse of an array in c programming

#include<stdio.h>

#include<conio.h>

void main ()

{

clrscr ();

int arr[5],i;

printf("enter marks of five students");

for(i=0;i<5;i++)

{

scanf(" %d",&arr[i]);

}

printf("the reverse elements are\n");

for(i=4;i>0;i--)

{

printf("%d",arr[i]);

}

getchar();

}

Similar questions