In: Computer Science
Create an ASP.NET Core MVC solution, edit the main view to contain an HTML form that asks for first name, last name, and email address. The form should also have a submit button, though the submit button doesn't have to do anything yet. looking for an HTML mockup inside an ASP.NET Core MVC Solution.
Please comment below, If you find any difficulty in understanding
Answer :
# include<stdio.h>
# include <stdlib.h>
int stack[10];
int MAX=10;
int left=-1;
int right=-1;
void input_right(){
int num;
printf("enter element");
scanf("%d",&num);
if((left==0 && right==MAX-1)||
left==right+1){
printf("Overflow");
}
else if(left==-1 && right ==-1){
left++;
right++;
stack[left]=num;
}
else if(left!=0 && right==MAX-1){
right=0;
stack[right]=num;
}
else{
right++;
stack[right]=num;
}
}
void input_left(){
int num;
printf("enter element");
scanf("%d",&num);
if((left==0 && right==MAX-1)||
left==right+1){
printf("Overflow");
}
else if(left==-1 && right ==-1){
left++;
right++;
stack[left]=num;
}
else if(left==0 && right!=MAX-1){
left=MAX-1;
stack[left]=num;
}
else{
left--;
stack[left]=num;
}
}
void delete_left(){
if (left==-1 && right==-1){
print("Overflow");
}
else if(left==right){
left=-1;
right=-1;
}
else if(left==MAX-1){
stack[MAX-1]=0;
left=0;
}
else{
stack[left]=0;
left++;
}
}
void delete_right(){
if (left==-1 && right==-1){
print("Overflow");
}
else if(left==right){
left=-1;
right=-1;
}
else if(right==0){
stack[0]=0;
right=MAX-1;
}
else{
stack[right]=0;
right--;
}
}
void display(){
int i;
for (i=0; i<MAX;i++){
printf("%d\t",stack[i]);
}
}
int main(){
int i, j;
printf("\n1-input resticted \n 2-output
resticted");
scanf("%d",&i);
if (i==1){
do{
printf("\n 1-
insert right\n2-delete left\n3-delete right\n4-exit\n");
scanf("%d",&j);
switch(j){
case 1:
input_right();
break;
case 2:
delete_left();
case 3:
delete_right();
case 4:
exit(0);
break;
}
}while(1);
}
else if(i==2){
do{
printf("\n 1-
insert right\n2-insert left\n3-delete left\n4-exit\n");
scanf("%d",&j);
switch(j){
case 1:
input_right();
break;
case 2:
input_left();
case 3:
delete_left();
case 4:
exit(0);
break;
}
}while(1);
}
else
printf("wrong option ");
display();
}