Computer Science, asked by StephenHawking7001, 10 months ago

Write a program to reverse a string

Answers

Answered by hanthi
0

Reverse a string in C using strrev

#include <stdio.h>

#include <string.h>

int main()

{Jio

char arr[100];

printf("Enter a string to reverse\n");

gets(arr);

strrev(arr);

printf("Reverse of the string is \n%s\n", arr);

return 0;

}

C reverse string program output:

Reverse string C program output

Answered by sushiladevi4418
0

Answer:

Write a program to reverse a string.

Explanation:

/*C program to reverse a string*/

#include <stdio.h>

#include <string.h>  

int main()

{

  char arr[100];

 

  printf("Enter a string to reverse: \n");

  gets(arr);

 

  strrev(arr);

 

  printf("Reverse of the string is: \n%s\n", arr);

 

  return 0;

}

Output:-

Enter a string to reverse: SIVAM

Reverse of the string is: MAVIS

Similar questions