mplementation of stack using any programing language



mplementation of stack using any programing language..

Answer / aravind

1. stack as an array or linked list (two ways)
2.define array.
3.perform push operation by taking one more array.
4.perform pop and store the popped items
5.display function to print the popped values
6.make sure you reach LIFO

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More C Interview Questions

What is the use of header?

0 Answers  


12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV

4 Answers   Accenture,


#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers  


how to find binary of number?

2 Answers  


#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300

4 Answers   Tieto,






Write one statement equalent to the following two statements x=sqr(a); return(x); Choose from one of the alternatives a.return(sqr(a)); b.printf("sqr(a)"); c.return(a*a*a); d.printf("%d",sqr(a));

6 Answers   TCS,


Why does notstrcat(string, "!");Work?

0 Answers  


#include<stdio.h> int main(){ int a[]={1,2,3,5,1}; int *ptr=a+4; int y=ptr-a; printf("%d",y); }

3 Answers   Zoho,


what is real time system?what is the differance between hard and soft real time systems

2 Answers  


Switch (i) i=1; case 1 i++; case 2 ++i; break; case 3 --i; Output of i after executing the program

5 Answers   Mascot,


What is size of union in c?

0 Answers  


What is the purpose of the code, and is there any problem with it? unsigned int f( unsigned n ) { return –n & 7; }

1 Answers   Google,


Categories