We have our final tomorrow and my teacher said we dont have to right the int fun
ID: 3695467 • Letter: W
Question
We have our final tomorrow and my teacher said we dont have to right the int functions or int main i forget but its one of them. Doesnt that mean we don't have to write the entire code but mostly some of it?
for example:
Question 5. Write a swap function that accepts two char arrays only. Function should swap the values stored in the arrays. See the example below: If the two character arrays are A: “suman” and B: “Ben”, the new value of A and B should A = “Ben”, and B: “Kumar”. Do not use any string function. [8]
ANSWER:
void swap(char A[],char B[]);
char A[10],B[10];
cout<<"Enter the first string:";
cin>>A;
cout<<"Enter the second string:";
cin>>B;
swap(A,B);
cout<<"The arrays after swapping is:"<<endl;
cout<<"A:"<<A<<" "<<"B:"<<B << endl;
return 0;
would this be correct.
Explanation / Answer
yes , that was correct
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.