CPPForSchool.com: String Set 1 Assignment 11

11. Write the output of the following program. Assume that all necessary header files are included.

void Encrypt(char T[])
{
    for (int i = 0; T[i] != '\0'; i += 2)
        if (T[i] == 'A' || T[i] == 'E')
            T[i] = '#';
        else if (islower(T[i]))
            T[i] = toupper(T[i]);
        else
            T[i] = '@';
}

int main()
{
    char text[]="SaVE EArtH";
    Encrypt(text);
    cout << text << endl;
    
    return 0;
}
--------------------------------------------------
@a@E@E#rTH

Comments

Popular posts from this blog

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 9

CPPForSchool.com: Array - Single Dimension Set 1 Assignment 6

CPPForSchool.com: Variable, Operator & Expression Set 1: Assignment 8