Skip to content

All issues corrected#2

Open
Shanks13-37 wants to merge 1 commit into
MysteriousCoder7:mainfrom
Shanks13-37:fixissue
Open

All issues corrected#2
Shanks13-37 wants to merge 1 commit into
MysteriousCoder7:mainfrom
Shanks13-37:fixissue

Conversation

@Shanks13-37

@Shanks13-37 Shanks13-37 commented Mar 1, 2025

Copy link
Copy Markdown

Changes made:

1

Initializing the rev string with elements of str string from backward.

##2
incrementing 'even' instead of 'i'.

##3
each element of the new string is initialized with the corresponding element of the z string in the for loop.

##4
bubble sort.

##5
The break should be for the case and not inside the for loop, then the break exits the for loop but not the case thus giving an error. And int flag =0 and declaring just the variable flag does not make any difference.

##6
strcmp gives 1 if the strings are the same but 1 is taken as false in the if statement so !strcmp corrects it.

##7
b is a pointer that has the address of 7 so (a+b) won't give us the sum of a+7, we need to dereference the pointer by writing *b so it (a+*b).

##8
The for loop goes on incrementing until it comes across \0 which is always at the end of the string literals stored in str.

##9
If n==0 then the value returned will be 1 if not then it implements the else statement which includes recursion.

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