Answered step by step
Verified Expert Solution
Question
1 Approved Answer
why cant I pass one arrays values to another with the program listed below: #include int array_a[10]; int array_b[10]; char temp[100]; int i = 0;
why cant I pass one arrays values to another with the program listed below:
#includeint array_a[10]; int array_b[10]; char temp[100]; int i = 0; int n = 0; int j = 0; int last; int final_array[25]; int main() { printf(" Enter up to 10 numbers for array A: "); gets(temp); while(temp[i] != '\0') { if(temp[i] != ' ') { array_a[n] = (int)(temp[i])-'0'; n++; } i++; } for(j = 0; j < n; j++) { final_array[n] = array_a[n]; } for(i = 0; i < 10; i++) { printf("%d", final_array[i]); } return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started