Look at that code
How may I aproach that. I would like to print the middle charactert of the string, if the string has an even number character ,I would like to print the right most character on the left half of the string
thanks
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
char data[20];
double temp,variable,temporary;
cout<<"input string:";
cin.getline(data,20);
cout<<"\nThe data you entered is: "<<data;
cout<<"\nThe middle character of the input is: ";
temporary=strlen(data);
variable=temporary/2;
if ((variable%2)==0)
cout<<((data[temporary/2-1]));
else
cout<<((data[temporary/2]));
getch();
return 0;
}