Excellent!!!
If I may humbly suggest a few visual suggestions, though:
#include <stdio.h>
#include <ctype.h>
char* Word[]= { "Alpha ", "Bravo ", "Charlie ", "Delta ", "Echo ",
"Foxtrot ", "Golf ", "Hotel ", "India ", "Juliet ",
"Kilo ", "Lima ", "Mike ", "November ","Oscar ",
"Papa ", "Quebec ", "Romeo ", "Sierra ", "Tango ",
"Uniform ", "Victor ", "Whiskey ", "X=ray ", "Yankee ",
"Zulu "
};
int main() // This is a comment
{
char inbuf[200];
char *p;
int i;
printf("Enter: ");
fgets(inbuf, 200, stdin);
p = inbuf;
while (*p)
{
if (isupper(*p))
{
i = *p - 'A';
printf("%s", Word[i]);
}
else
if (islower(*p))
{
i = *p - 'a';
printf("%s", Word[i]);
}
else
{
putchar(*p);
}
p++;
}
return 1;
}
To follow more closely what I've seen:
comments in green
"Strings" and 'characters' in blue
Numbers in dark blue
Keywords in bold purple (no underline)
All else is black
C/C++ functions don't need to be colored, but if they are, use a dark color like
maybe red
All the colors should be of a similar intensity. The switch from the keyword-yellow to function-underline/blue is too striking.
#include <stdio.h>
#include <ctype.h>
char* Word[]= { "Alpha ", "Bravo ", "Charlie ", "Delta ", "Echo ",
"Foxtrot ", "Golf ", "Hotel ", "India ", "Juliet ",
"Kilo ", "Lima ", "Mike ", "November ","Oscar ",
"Papa ", "Quebec ", "Romeo ", "Sierra ", "Tango ",
"Uniform ", "Victor ", "Whiskey ", "X=ray ", "Yankee ",
"Zulu "
};
int main() // This is a comment
{
char inbuf[200];
char *p;
int i;
printf("Enter: ");
fgets(inbuf, 200, stdin);
p = inbuf;
while (*p)
{
if (isupper(*p))
{
i = *p - 'A';
printf("%s", Word[i]);
}
else
if (islower(*p))
{
i = *p - 'a';
printf("%s", Word[i]);
}
else
{
putchar(*p);
}
p++;
}
return 1;
}
I also notice in the [code=c] section, there is no formatting displayed in the edit window. I assume that's just a glitch, but I thought I'd at least point it out, just in case.
Also, is there a possibility to close up the gap between lines just a tad -- at least as a test? I'd like to see a little less space and a little more code. Instead of 1.5 spacing maybe 1.25.