Write a function code for stack pop operation

void pop(){
	  int val;
	  if(top==-1){
		printf("underflow");
	  }
	  else{
		val=stack[top];
		top--;
		printf("Deleted item :%d",val);
	  }
}