Write a C program using arrays that inputs 20 real numbers t

Write a C program using array(s) that inputs 20 real numbers, then displays it backward on the screen. Print the given array and backward array.

Solution

#include<stdio.h>
int main()
{
   int array[20];
   int i,j,k;
   for(i=0;i<20;i++)
   {
       array[i]=i+1;
   }
   for(j=0;j<20;j++)
   {
       printf(\"Element[%d]=%d\ \",j,array[j]);
   }
   for(k=1;k<21;k++)
   {
       printf(\"Element[%d]=%d\ \",20-k,array[20-k]);
   }
   return 0;
}

 Write a C program using array(s) that inputs 20 real numbers, then displays it backward on the screen. Print the given array and backward array.Solution#includ

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site