Question: I don't know what's wrong with my C Programming Language, this is my code and error screenshot #include void rearrange(int *a, int n, int insert,

I don't know what's wrong with my C Programming Language, this is my code and error screenshot

#include

void rearrange(int *a, int n, int insert, int *b)

{

int *d = a;

for(int i = 0; i

{

int c = *a;

if(c

{

*b = c;

*b++;

}

*a++;

}

*b = insert;

*b++;

for(int i = 0; i

{

int c = *d;

if(c > insert)

{

*b = c;

*b++;

}

*d++;

}

}

int main()

{

int n, insert;

printf("Enter the length of the array: ");

scanf("%d",&n);

int a[n], b[n];

printf("Enter the elements of the array: ");

for(int i = 0; i

{

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

printf("Enter the number for insertion: ");

scanf("%d",&insert);

rearrange(a,n,insert,b);

printf("Output: ");

}

for(int i=0; i

{

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

printf(" ");

}

return 0;

}

I don't know what's wrong with my C Programming Language, this is

arrays.c: In function rearrange" : arrays.c:9:5: error: 'for' loop initial declarations are only allowed in 199 mode for(int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!