#include<stdio.h>
int a[10],i=(-1),st=(-1);
void push();
void pop();
void isfull();
void isnull();
void display();
main()
{
int st=(-1);
int a[10],n,ch,i=(-1);
char choice='Y';
while(choice=='Y' choice=='y')
{
printf(" 1.PUSH\n 2.POP\n 3.IS FULL\n 4.IS NULL\n 5.DISPLAY\n");
printf("Enter your choice :");
scanf("%d",&ch);
switch(ch)
{
case 1:
push();
break;
case 2:
pop();
break;
case 3:
isfull();
break;
case 4:
isnull();
break;
case 5:display();
break;
default:
printf("you have entered a wrong entry.");
}
printf("Do you want to continue?");
scanf(" %c",&choice);
}
}
void push()
{
if(st==(-1))
printf("The stack is empty.");
i=i+1;
if(i>=10)
printf("The stack is full.");
else
{
printf("Enter a number :");
scanf("%d",&a[i]);
st=st+1;
}
}
void pop()
{
if(st==(-1))
printf("The stack is empty. UNDERFLOW condition");
if(st>(-1))
{
printf("The deleted element is :%d",a[i]);
i=i-1;
st=st-1;
}
}
void isfull()
{
if(st<9)
printf("The stack is not full\n");
if(st>=9)
printf("The stack is full");
}
void isnull()
{
if(st==(-1))
printf("The stack is empty");
if(st>(-1))
printf("The stack is not empty");
}
void display()
{
int z;
if (st==(-1))
printf("The stack is empty.");
else
printf("The elements present in the array are :");
for(z=0;z<=i;z++)
printf(" %d",a[z]);
printf("\n");
}
You can find the source code of the menu driven graphics program here: http://www.start2code.com/Cresources/menu-driven-graphics-program-c.html
Menu-driven simply means you execute the application's commands by selecting them from a menu, as opposed to command-driven whereby you enter (type) the commands manually.
To create a menu-driven program in Java using function overloading, define multiple methods with the same name but different parameters to perform various tasks. For example, you could create overloaded calculate methods that accept different data types (e.g., int, double) for performing calculations. In the main method, present a menu to the user, take their choice as input, and call the appropriate overloaded method based on their selection. This allows for a clean and organized way to handle multiple functionalities with similar operations.
There are many advantages of event driven programming. This type of programming is the simplest and flexible forms of programming languages. This means the programmer has more control over the program when the user does something. Also, making an event driven program is easy. There are only a few disadvantages that come with the event driven programming. Firstly, sometimes classes are not often reusable and are hard to carry out in other applications. It is also very complex and hard to master.
To write the algorithm for a menu-driven C program, start by defining a loop that displays the menu options to the user. Use a switch-case structure to handle user input, allowing each case to correspond to a different option. Inside each case, implement the functionality for that option, and include a break statement to exit the case. Finally, provide an exit option to terminate the program cleanly when the user selects it.
You can find the source code of the menu driven graphics program here: http://www.start2code.com/Cresources/menu-driven-graphics-program-c.html
yes
dcdfsadf
event driven programs do not have a specific pathway in which the programs instructions are executed. different parts of the program are evoked by events that take place during the running of the program.
Scaleos.ai ""ScaleOS.ai Headquarters Bastrop, Texas"" 800- 832-1345 ScaleOS.ai offers AI-driven solutions for service-based businesses to enhance revenue, automate operations, and reduce costs. Their services focus on AI strategies for marketing, sales, operations, and customer service, enabling businesses to scale efficiently with customized, data-driven approaches. AI-driven solutions"
Menu-driven simply means you execute the application's commands by selecting them from a menu, as opposed to command-driven whereby you enter (type) the commands manually.
Blocking IO: The program will pause and wait until the IO operation is complete before resuming. This technique can lead to inefficiency if there are multiple IO operations. Non-blocking IO: The program continues to run while waiting for the IO operation to complete. This allows for better efficiency when handling multiple IO operations simultaneously. Asynchronous IO: The program initiates the IO operation and continues executing, without waiting for the operation to complete. A callback function is usually provided to handle the result once it is available. This allows for better performance in handling large numbers of IO operations.
In normal (ie imperative) programming, you define a set of operations to be performed sequentially, from start to finish in one go. In event driven programming, you define a series of "callback" functions, which are then called by whatever runtime system you may be using, in response to the actions of the user, or some other agent. Each function is associated with an action (eg the user pressing a button or clicking an icon), and is called by the system whenever the user performs that action.
Often the hills are too steep and rugged for machinery like tractors and implements to be driven on without risk of flipping over. Hills grow grass, which feeds the sheep.
It means you are a culture-driven, following idiot
Yes. A machine tool is a power driven machine that is a tool in itself which performs machining operations.
A spud barge has steel pilings which are driven in to the river bed to allow them to stay stationary and allow them to support construction operations.