Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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;

}

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

Describe the two constraints on providing useful information.

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago