Skip to content

Corrected all issues#4

Open
vm1-23 wants to merge 3 commits into
MysteriousCoder7:mainfrom
vm1-23:correction
Open

Corrected all issues#4
vm1-23 wants to merge 3 commits into
MysteriousCoder7:mainfrom
vm1-23:correction

Conversation

@vm1-23

@vm1-23 vm1-23 commented Mar 1, 2025

Copy link
Copy Markdown

Corrections made:

  1. Reverse function returned the same string. Reversed the assignment of characters.
  2. Printed only zeroes and had 21 iterations. Changed the assignment operator and reduced number of iterations by 1.
  3. Fixed error in the assignment of each character in the given string to the string "new".
  4. Fixed logical error in the 2nd for loop conditions.
  5. Added break statements in every case.
  6. Fixed condition in if statement according to strcmp() return value.
  7. Dereferenced b in print statement since b is a pointer.
  8. Changed for loop condition to stop iterating on encountering a null character instead of taking an arbitrary value.
  9. Changed base case conditions to include 0 and 1 and give the correct factorial value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant