Question: C PROGRAM NEED SAME OUTPUT DONOT GIVE IRRELEVANT OUTPUT 1 - WAP to reverse the given string using iterative method Description: Read a string from
C PROGRAM NEED SAME OUTPUT DONOT GIVE IRRELEVANT OUTPUT
1 - WAP to reverse the given string using iterative method
Description:
Read a string from user.
Implement using loops.
Do not print character by character.
Pr-requisites:-
Strings
Loops
Objective: -
To understand the concept of
Reversing the string
Inputs: -
String
Sample execution: - Test Case 1: Enter a string : Hello World Reverse string is : dlroW olleH
Test Case 2: Enter a string : EMERTXE Reverse string is : EXTREME
REQUESTED FILE ALSO NEED
#include
void reverse_iterative(char str[]);
int main() { char str[30]; printf("Enter any string : "); scanf("%[^ ]", str); reverse_iterative(str); printf("Reversed string is %s ", str); }
\\
2
A42 - WAP to reverse the given string using recursive method
Description:
Read a string from user.
Implement using recursive function without using any loops
Do not print character by character.
Pr-requisites:-
Strings
Loops
Objective: -
To understand the concept of
Reversing the string
Inputs: -
String
NOTE : Should not use static, global variables and loops
Sample execution: - Test Case 1: Enter a string : Hello World Reverse string is : dlroW olleH
Test Case 2: Enter a string : EMERTXE Reverse string is : EXTREME
REQUESTED FILE
#include
void reverse_recursive(char str[], int ind, int len);
int main() { char str[30]; printf("Enter any string : "); scanf("%[^ ]", str); reverse_recursive(str, ?, ?); printf("Reversed string is %s ", str); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
