ctype.h

what is the output of this programme and how they come ..pls help me..

#include <iostream.h>
#include <ctype.h>
void ChangeIt(char Text[ ], char C)
{
for (int K=0;Text[K]!='\0';K++)
{
if (Text[K]>=’F’ && Text[K]<=’L’)
Text[K]=tolower(Text[K]);
else
if (Text[K]=’E’ || Text[K]==’e’)
Text[K]= =C;
else
if (K%2==O)
Text[K]=toupper(Text[K]);
else
Text[K]=Text[K-l];
}
}

void main ( )
{
char OldText[ ]=”pOwERALone”;
ChangeIt(OldText,’%’);
cout<<“New TEXT:”<<OldText<<endl;
}
Did you run it?
What result did you get?

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.

BTW, main() should be type int, not void.
Last edited on
Topic archived. No new replies allowed.