import java.io.*;
class Stack
{
int s[]=new int[7];
int t=-1;
void push(int x)
{
if(t==6)
{
System.out.println("stack is full");
return;
}
s[++t]=x;
}
void pop()
{
if(t==-1)
{
System.out.println("stack is empty");
}
else
{
System.out.println("element deleted from stack is"+s[t--]);
}
}
void display()
{
if(t==-1)
{
System.out.println("stack is empty");
}
else
{
for(int i=0;i<=t;i++)
System.out.println(s[i]);
}
}
}
class Stack1
{
public static void main(String[] args)throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Stack y=new Stack();
System.out.println("Menu");
System.out.println("1.push");
System.out.println("2.pop");
System.out.println("3.display");
System.out.println("4.exit");
out:while(true)
{
System.out.println("enter your choice");
int ch=Integer.parseInt(br.readLine());
switch(ch)
{
case 1:
{
System.out.println("enter the value");
int n=Integer.parseInt(br.readLine());
y.push(n);
break;
}
case 2:
{
y.pop();
break;
}
case 3:
y.display();
break;
case 4:break out;
}
}
}
}
New evolution of the Mouse. In 1980's round ball mouses are invented, then technology introduced Optical mouses. Now upcoming Mouse is named as Evo mouse . No more movement of your hands on placing a physical mouse, Your finger is the pointer . You can use this mouse on any Flat Surface and also it requires very little space. This mouse contains a Power button on the top, Mini USb port . It works with the help of bluetooth and input is taken by the sensor. View this Video to know the functionality of EvoMouse
Comments
Post a Comment