Home / C Programming / Strings :: Discussion

Discussion :: Strings

  1. What will be the output of the program ?

     #include
     #include 
    
     int main()
     {
         char sentence[80];   
         int i;   
         printf("Enter a line of text\n");   
         gets(sentence);     
         for(i=strlen(sentence)-1; i >=0; i--)         
            putchar(sentence[i]);   
         return 0; 
     } 
    

  2. A.

    The sentence will get printed in same order as it entered

    B.

    The sentence will get printed in reverse order

    C.

    Half of the sentence will get printed

    D.

    None of above

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    No answer description available for this question.


Be The First To Comment