Computer Science, asked by chejerlasri6493, 9 months ago

Write a program in c which accepts an integer array and its size as argument

Answers

Answered by Anonymous
0

Explanation:

What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array? The element will be set to 0. The compiler would report an error. The program may crash if some important data gets overwritten.

Answered by ItzDevilQueen07
6

Answer:

So basically you have to follow algorithm steps as follows,

You can refer following code,

#include <stdio.h>

#include <stdlib.h>

int main() { int *a,*b,i; a= (int*)malloc(10*sizeof(int));

for(i=0;i<10;i++) { scanf("%d",&a[i]); }

for(i=0;i<10;i++) { printf("%d",a[i]); } ...

for(i=9;i>=0;i--) { printf("%d",a[i]); } return0

Explanation:

hope it helps you........

Similar questions