Home / C Programming / Pointers :: Discussion

Discussion :: Pointers

  1. Which statement will you add to the following program to ensure that the program outputs "FRESHERGATE" on execution?

    #include 
     int main() 
     {
         char s[] = "FRESHERGATE"; 
         char t[25];   
         char *ps, *pt;    
         ps = s;     
         pt = t;     
         while(*ps)     
             *pt++ = *ps++;
         
     /* Add a statement here */       
        printf("%s\n", t);
        return 0;
     } 
    

  2. A.

    *pt='';

    B.

    pt='\0';

    C.

    pt='\n';

    D.

    *pt='\0';

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    No answer description available for this question.


Be The First To Comment