Write a program to read a string and write it in reverse order.|Shubham tiwari


Aim:-Write a program to read a string and write it in reverse order. (Using only string length function “strlen”)

Source Code:-

#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

Post a Comment

0 Comments

Copyright (c) 2019 Designed by Shubham tiwari All Right Reseved