import java.io.*;
import java.util.*;
class Stac
{
int st_arr[]=new int[100];
int t=-1;
void push(int ele)
{
if(t==99)
{
System.out.println("STACK is Full.\n");
return;
}
st_arr[++t]=ele;
}
int pop()
{
if(t==-1)
{
return -99;
}
return(st_arr[t--]);
}
}
class Post
{
public static void main(String[] args) throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
Stac s=new Stac();
System.out.println("Enter an postfix expression");
String s1=br.readLine();
StringTokenizer s2=new StringTokenizer(s1);
String a[]=new String[s2.countTokens()];
int j=0;
while(s2.hasMoreTokens())
a[j++]=s2.nextToken();
for(int i=0;i<a.length;i++)
{
if(a[i].equals("+"))
{
int a1=s.pop();
int a2=s.pop();
s.push(a1+a2);
}
else if(a[i].equals("-"))
{
int a1=s.pop();
int a2=s.pop();
s.push(a1-a2);
}
else if(a[i].equals("*"))
{
int a1=s.pop();
int a2=s.pop();
s.push(a1*a2);
}
else if(a[i].equals("/"))
{
int a1=s.pop();
int a2=s.pop();
s.push(a1/a2);
}
else if(a[i].equals("%"))
{
int a1=s.pop();
int a2=s.pop();
s.push(a1%a2);
}
else
{
s.push(Integer.parseInt(a[i]));
}
}
System.out.println("The result is "+s.pop());
}
}
The most common method to Hide your IP address is to use a PROXY server. Proxy server is a computer network service that provides an indirect connections between other computer networks. By using this proxy sites we can access any website with out revealing our IP address. This is the best method to keep your IP address secure. Here is the free proxy server website link. http://www.freeproxyserver.ca/ We need to type the URL of such as (www.facebook.com) in the box given in the site, then we can browse it with out providing our IP address
Comments
Post a Comment