Home / C Programming / Strings :: Discussion

Discussion :: Strings

  1. What will be the output of the program in Turbo C?

      #include
     
      int main() 
      {    
          char str[10] = "Fresher";    
          str[6] = "GATE";     
          printf("%s\n", str);     
          return 0;
      } 
    

  2. A.

    Fresher GATE

    B.

    GATE

    C.

    Fresher

    D.

    Error

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    str[6] = "GATE"; - Nonportable pointer conversion.


Be The First To Comment