Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

include

int choice, stack[10], top, element;

void menu();

void push();

void pop();

void showelements();

void main()

{

choice=element=1;

top=0;

menu();

}

void menu()

{

printf("Enter any options from following:\n");

printf("PUSH 1\n POP 2\n DISPLAY ELEMENTS 3\n EXIT 4\n");

scanf("%d", &choice);

if (choice==1)

{

push();

menu();

}

if (choice==2)

{

pop();menu();

}

if (choice==3)

{

showelements();

menu();

}

void push()

{

if (top<=9)

{

printf("Enter any element to be pushed to stack:\n");

scanf("%d", &element);

stack[top]=element;

++top;

}

else

{

printf("Stack full\n");

}

return;

}

void pop()

{

if (top>0)

{

--top;

element = stack[top];

printf("Popped element:%d\n", element);

}

else

{

printf("Stack empty\n");

}

return;

}

void showelements()

{

if (top<=0)

printf("Stack empty\n");

else

for(int i=0; i

printf("%d\n", stack[i]);

}

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9619044

Have any Question?


Related Questions in Computer Engineering

Question what will be the source and destination ip

Question : What will be the source and destination IP addresses the response packet after the router forwards it to the private network? The response must be typed, single spaced, must be in times new roman font (size 12 ...

Using c language how to write a function name bsqrt that

Using C++ language, how to write a function name bsqrt that will compute the square root of a number using the Babylonian method. This function will take the number x to compute the square root for and the number of iter ...

Question the states of california arizona new mexico utah

Question : The States of California, Arizona, New Mexico, Utah, and Nevada each send a team of 6 delegates to the Sounth Western States annual conference. A sub commitee of 9 is to be formed to discuss water rights. How ...

Question need to discuss on issues and security

Question: Need to discuss on issues and security vulnerabilities caused by using 4 digit pin while accessing Banking. 1) Abstract 2) Acknowledgement 3) List of Abbreviations 4) Table of contents 5) List of tables 6) List ...

Question using a web browserand a search engine the terms

Question: Using a web browserand a search engine the terms "citibank backup tapes lost." You will find many results. Select one article and identify what that article considers a ,short coming in citibank's planning. Wha ...

Each of the following lists has an average of 50 for which

Each of the following lists has an average of 50. For which one is the spread of the numbers around the average biggest?smallest? a. 0, 20, 40, 50, 60, 80, 100 b. 0, 48, 49, 50, 51, 52, 100 c. 0, 1, 2, 50, 98, 99, 100 Gu ...

Recall merge sort sorts a vector of elements rewrite merge

Recall Merge Sort sorts a vector of elements. Rewrite Merge Sort to sort a list of elements. You may use your own List or STL list. This must be in C++. Write your own version of merge_sort(), merge(), and copy() functio ...

The below figure represents the potential outcomes of your

The below figure represents the potential outcomes of your first salary negotiation after graduation. Assuming this is a sequential-move game with the employer moving first, indicate the most likely outcome. Does the abi ...

For the following reactionnbsp199nbspgrams ofnbspcarbon

For the following reaction,  19.9  grams of  carbon monoxide  are allowed to react with  14.4  grams of  oxygen gas . Carbon monoxide  ( g ) +  oxygen  ( g )  ------>  carbon dioxide  ( g ) What is the maximum amount of  ...

How to design a java program that reads a sentence say s

How to design a Java program that reads a sentence, say s, consisting of lower-case words with .nextLine() method, identifies the words using .indexOf() and .substring() methods and saves them in String variables. Then t ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As