#include<iostream.h>
#include<cstdlib>
#include<stdlib.h>
main()
{
char word [3];
int a;
char b;
char c;
char d;
char e;
char f;
char g;
char h;
char i;
cout<<"Press one to reverse the letters of a word."<<endl;
cout<<"Press two to invert the case of the letters."<<endl;
cout<<"Press three to exit"<<endl;
cin>>a;
{
if (a=='1')
cout<<"Please input a four letter word"<<endl;
cin.get(word,3);
cin.ignore(80,'\n');
system("cls");
b= (word[0]);
c= (word[1]);
d= (word[2]);
e= (word[3]);
cout<<word [3]<<endl;
}
{
if (a=='2')
cout<<"Please input a four letter word"<<endl;
cin.get(word,3);
cin.ignore(80,'\n');
system("cls");
f=int (word[0]);
g=int (word[1]);
h=int (word[2]);
i=int (word[3]);
f=f-32;
g=g-32;
h=h-32;
i=i-32;
cout<<f+g+h+i<<endl;
}
{
if (a=='3')
exit(1);
}
return 0;
}
Please edit your post and make sure your code is [code]between code tags[/code] so that it has line numbers and syntax highlighting, as well as proper indentation.
Do you want to use C, or C++? It isn't clear from your post.
In either language, char is a numeric type that just gets special treatment in some cases. The + operator performs addition, not concatenation.