Take a odd string give output middle of string
#include<conio.h>
#include<stdio.h>
#include<iostream.h>
#include<string.h>
char func( char str1[]);
void main(void)
{
clrscr();
char a[20],result;
cout<<"enter any word";
gets(a);
result=func(a);
cout<<result;
getch();
}
char func(char str1[])
{
int a,b,f;
char m;
a=strlen(str1);
if((a%2)==1);
{
m=char(str1);
return m;
}
}
for example:
cat input
output
a