#include<conio.h>
#include<stdio.h>
#include<iostream.h>
#include<string.h>
#define MAX 80
void main()
{ int length;
clrscr() ;
char string1[MAX+1] ;
puts("Enter the string \n");
gets(string1);
puts(string1);
length=strlen(string1);
cout<<"Length of string is "<<length<<"\n";
for(int i=length-1; i>=0;i--)
{
cout<<string1[i];
}
getch();
}
#include<stdio.h>
#include<iostream.h>
#include<string.h>
#define MAX 80
void main()
{ int length;
clrscr() ;
char string1[MAX+1] ;
puts("Enter the string \n");
gets(string1);
puts(string1);
length=strlen(string1);
cout<<"Length of string is "<<length<<"\n";
for(int i=length-1; i>=0;i--)
{
cout<<string1[i];
}
getch();
}
No comments:
Post a Comment