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

Write a program in c to input a 5 digit number and print it in words.

11 Answers  


What is a file descriptor in c?

0 Answers  


Is c is a middle level language?

0 Answers  


Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?

0 Answers   Genpact,


What are the usage of pointer in c?

0 Answers  


write a c program for greatest of three numbers without using if statment

4 Answers   IBM,


int arr[] = {1,2,3,4} int *ptr=arr; *(arr+3) = *++ptr + *ptr++; Final contents of arr[]

6 Answers   Hughes,


What is the difference between Printf(..) and sprint(...) ?

0 Answers   InterGraph,


identify the in correct expression a.a=b=3=4; b.a=b=c=d=0; float a=int b=3.5; d.int a; float b; a=b=3.5;

8 Answers   TCS,


Are pointers integer?

0 Answers  


You have an int array with n elements and a structure with three int members. ie struct No { unsigned int no1; unsigned int no2; unsigned int no3; }; Point1.Lets say 1 byte in the array element is represented like this - 1st 3 bits from LSB is one number, next 2 bits are 2nd no and last 3 bits are 3rd no. Now write a function, struct No* ExtractNos(unsigned int *, int count) which extracts each byte from array and converts LSByte in the order mentioned in point1.and save it the structure no1, no2, no3. in the function struct No* ExtractNos(unsigned int *, int count), first parameter points to the base address of array and second parameter says the no of elements in the array. For example: if your array LSB is Hex F7 then result no1 = 7, no2 = 2, no3 = 7. In the same way convert all the elements from the array and save the result in array of structure.

2 Answers   Qualcomm,


how to set Nth bit of a variable?

1 Answers  


Categories