Home » C++ Programming » Dynamic Memory » Question
  1. What is the output of this program?
    #include <iostream> 
    #include <ctype.h>
    int main ()
    {
    int k = 0;
    char str[] = "Ajit Kumar Gupta";
    char ch;
    while (str[k])
    {
    ch = str[k];
    if (islower(ch))
    ch = toupper(ch);
    putchar (ch);
    k++;
    }
    return 0;
    }
    1. AJIT KUMAR GUPTA
    2. Ajit Kumar Gupta
    3. Compilation Error
    4. Runtime Error
    5. None of these
Correct Option: A

In this program, We have converted the lower case letters to uppercase letters by using toupper function.



Your comments will be displayed only after manual approval.