Embed presentation
Download to read offline
![#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
intmain() {
int n;
scanf("%d",&n);
int i = 0;
int array[1000];
for (i;i<n;i++)
{
scanf("%d",&array[i]);
}
i = n-1;
for (i;i>-1;i--)
{
printf("%d",array[i]);
}
/* Enteryour code here.ReadinputfromSTDIN.Printoutputto STDOUT */
return0;
}](https://image.slidesharecdn.com/newmicrosoftworddocument-211128071623/75/New-microsoft-word-document-1-2048.jpg)
This C code snippet includes header files for input/output, strings, math, and standard library functions. It defines an integer variable n to store the length of an array input by the user, initializes an array of 1000 integers, uses a for loop to input n integers into the array from standard input, then uses a reverse for loop to output all array elements from last to first to standard output.
![#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
intmain() {
int n;
scanf("%d",&n);
int i = 0;
int array[1000];
for (i;i<n;i++)
{
scanf("%d",&array[i]);
}
i = n-1;
for (i;i>-1;i--)
{
printf("%d",array[i]);
}
/* Enteryour code here.ReadinputfromSTDIN.Printoutputto STDOUT */
return0;
}](https://image.slidesharecdn.com/newmicrosoftworddocument-211128071623/75/New-microsoft-word-document-1-2048.jpg)