Examveda

What will be the output of the following program?
main()  
{  
   char str[]="hello india";  
   int len = strlen(str);  
   int i;  
 
   for(i=0;i<len;i++)  
        push(str[i]);  // pushes an element into stack
 
   for(i=0;i<len;i++)  
      pop();  //pops an element from the stack
}

A. helloindia

B. hello india

C. aidni olleh

D. india hello

Answer: Option C


This Question Belongs to Data Structure >> Stacks In Data Structures

Join The Discussion

Related Questions on Stacks in Data Structures