Home / C Programming / Strings :: Yes / No Questions

C Programming :: Strings

  1. Will the program compile successfully?

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

     

  2. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. For the following statements will arr[3] and ptr[3] fetch the same character?
    char arr[] = "FresherGATE";
    char *ptr = "FresherGATE";

  4. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Is there any difference between the two statements?
    char *ch = "FresherGATE";
    char ch[] = "FresherGATE";

  6. A.

    Yes

    B.

    No

    View Answer

    Workspace

    Discuss Discuss in Forum