Showing posts with label Study. Show all posts
Showing posts with label Study. Show all posts

Thursday, January 08, 2009

Maharashtra State MBA CET Exam Pattern

There are many ways of going forward towards MBA and CET is one of them. Despite CAT being the most popular test, CET- the last exam of the season- is considered great enough to achieve the best life can offer and that too, without major surprises. CET stands for “Common Entrance Test” – conducted by the Directorate of Technical Education, Maharashtra.In case you need to pursue an MBA degree course from any of the affiliated universities in Maharashtra, you need to take this test.
Eligibility
· The candidate should either be a graduate with minimum 45% marks or in the final year graduation
· In case he/she is in the final year graduation, he/she should be in a position to submit his final marksheet by the September of the year of taking the CET.
Pattern
The CET is made up of 5 components :
1. The Written Test:
The written test comprises of 200 marks,divided in the following areas :Following tables give the break-up of the questions according to the sections.
Detailed Analysis–Topic-wise
(1) Reasoning Ability:
a.Type: Analytical Reasoning
Alpha Numeric Series
Coding(Vowel by #)
Number series (odd man out)
Symbols and Notations
Individual (Blood relation coding )etc sitting arrangement
b.Type: Verbal
Statement Conclusion
Others (Degree of truth)
c.Type: Logical
Venn-diagram based
(2) Quantitative Ability :
a.BODMAS, Approximations
b.Data Comparison
c.Probability
d.Simple InterestCompound Interest
e.Permutation
f.Time and work
g.Time and Distance
h.Circle
(3) Visual Reasoning:
a.Missing term
b.Odd term
c.Next term
d.Analogies
(4) Data Interpretation and Data Sufficiency:
Type Topic
a. Table (%) Appear % pass
b. Bar (Child,male,female in societies)
c. Line graph,( Profit% of Company A B & C)
d. Table Factory(Men Women HR administration)
e. Data Sufficiency & Blood Relation
(5) Language Comprehension:
a.Reading Comprehension
b.Grammatical errors (Phrases)
c.Fill in the blanks (Paragraph)
* It must be noted that the CET is not divided into any sections. All the questions are spread across the entire paper randomly.
2.Group Discussion (GD) :
· The GD comprises of 17 marks
· There are usually 10 members in a team and is evaluated by a panel of 3.
· A typical CET GD lasts for 20–30 min.
3. Personal Interview (PI) :
· The Personal Interview comprises of 17 marks
· The interview is usually conducted by a panel of 2.
· The PI usually lasts for 20- 30 min.
4. Academics :
· Marks for SSC or 10th Standard
2 marks if you have more than 75%
1 mark if you have between 60% to 75%
· Marks for HSC or 12th Standard
2 marks if you have more than 75%
1 mark if you have between 60% to 75%
5. Work Experience:
· 2 marks if you have more than 3 years of Work Experience
· 1 mark if you have 1 to 3 years of Work Experience
· The Experience should satisfy the following 3 conditions :
(a) It should be had after Graduation
(b) It should be full- time
(c) It should be in a listed company
So, totally CET comprises of 240 marks. Every student gets his score out of 240 marks and based on the marks each candidate gets a unique merit rank.


Special Thanks To Sushant Kulkarni.For Sample Paper mail me at sree.tumma@gmail.com
and
For more Information regarding MBA, please visit at http://vijaya-thorat.blogspot.com/

Sunday, January 04, 2009

Programs of Data Structures

Hi friends,
As i found many students face problems regarding Data Structure programs though they are well known about the respective algorithms,
here are some simple Data Structure programs totally based on algorithms........


*Program of stack:

#include"stdio.h"
#include"conio.h"
#define max 5
int stack[max],top=-1;
void push(int );
void pop();
void display();
int overflow();
int underflow();
void main()
{
int n,op;
char ch;
do
{
clrscr();
printf("\n 1-push 2-pop 3-display 4-exit\n");
printf("\n enter ur option\n");
scanf("%d",&op);
switch(op)
{
case 1 :
{
do
{
clrscr();
printf("\n enter element to insert\n");
scanf("%d",&n);
push(n);
printf("\n would u like to push another element (y/n)\n");
fflush(stdin);
ch=getchar();
}
while(ch=='y' ch=='Y');
break;
}
case 2 :
{
do
{
clrscr();
pop();
printf("\n would u like to pop another element (y/n)\n");
fflush(stdin);
ch=getchar();
}
while(ch=='y' ch=='Y');
break;
}
case 3 :
{
clrscr();
display();
break;
}
case 4 :
exit(0);
default :
{
printf("invalid option");
}
};
printf("\n would u like to continue (y/n)\n");
fflush(stdin);
ch=getchar();
}while(ch=='y' ch=='Y');
getch();
}
int overflow()
{
if(top==max-1)
return 1;
else
return 0;
}
int underflow()
{
if(top==-1)
return 1;
else
return 0;
}
void push(int n)
{
if(overflow())
printf("\nstack is full\n");
else
{
top++;
stack[top]=n;
printf("\n%d element is pushed in to stack\n",n);
}
}
void pop()
{
int m;
if(underflow())
printf("\nstack is empty\n");
else
{
m=stack[top];
top--;
printf("\n%d element is deleted\n",m);
}
}
void display()
{
int i;
if(underflow())
printf("\nstack is empty\n");
else
{
for(i=top;i>=0;i--)
{
printf("\n %d\t",stack[i]);
}
}
}


*Program of queue:

#include"stdio.h"
#include"conio.h"
#define max 5
int queue[max],f=-1,r=-1;
void insert(int );
void delete();
void display();
int overflow();
int underflow();
void main()
{
int n,op;
char ch;
do
{
clrscr();
printf("\n 1-insert 2-delete 3-display 4-exit\n");
printf("\n enter ur option\n");
scanf("%d",&op);
switch(op)
{
case 1 :
{
do
{
clrscr();
printf("\n enter element to insert\n");
scanf("%d",&n);
insert(n);
printf("\n would u like to insert another element (y/n)\n");
fflush(stdin);
ch=getchar();
}
while(ch=='y' ch=='Y');
break;
}
case 2 :
{
do
{
clrscr();
delete();
printf("\n would u like to delete another element (y/n)\n");
fflush(stdin);
ch=getchar();
}
while(ch=='y' ch=='Y');
break;
}
case 3 :
{
clrscr();
display();
break;
}
case 4 :
exit(0);
default :
{
printf("invalid option");
}
};
printf("\n would u like to continue (y/n)\n");
fflush(stdin);
ch=getchar();
}while(ch=='y' ch=='Y');
getch();
}
int overflow()
{
if(r>=max-1)
return 1;
else
return 0;
}
int underflow()
{
if(f==-1)
return 1;
else
return 0;
}
void insert(int n)
{
if(overflow())
printf("\n queue is full\n");
else
{
r++;
queue[r]=n;
if(f==-1)
f=0;
printf("\n%d element is inserted in to queue\n",n);
}
}
void delete()
{
int m;
if(underflow())
printf("\nqueue is empty\n");
else
{
m=queue[f];
if(f==r)
f=r=-1;
else
f++;
printf("\n%d element is deleted\n",m);
}
}
void display()
{
int i;
if(underflow())
printf("\n queue is empty\n");
else
{
for(i=f;i<=r;i++)
{ printf("\n %d\t",queue[i]);
} } }

*Program of circular queue:

#include"stdio.h"
#include"conio.h"
#define max 5
int queue[max],f=-1,r=-1;
void insert(int );
void delete();
void display();
int overflow();
int underflow();
void main()
{
int n,op;
char ch;
clrscr();
printf("\n************Program for implementation of cqueue using array**************\n\n");
do
{
printf("\n 1-insert 2-delete 3-display 4-exit\n");
printf("\n enter ur option\n");
scanf("%d",&op);
switch(op)
{
case 1 :
{
do
{
printf("\n enter element to insert\n");
scanf("%d",&n);
insert(n);
printf("\n would u like to insert another element (y/n)\n");
fflush(stdin);
ch=getchar();
}
while(ch=='y' ch=='Y');
break;
}
case 2 :
{
do
{
delete();
printf("\n would u like to delete another element (y/n)\n");
fflush(stdin);
ch=getchar();
}
while(ch=='y' ch=='Y');
break;
}
case 3 :
{
display();
break;
}
case 4 :
exit(0);
default :
{
printf("invalid option");
}
};
printf("\n would u like to continue (y/n)\n");
fflush(stdin);
ch=getchar();
}while(ch=='y' ch=='Y');
getch();
}
int overflow()
{
if(f==0 && r>=max-1 f==r+1)
return 1;
else
return 0;
}
int underflow()
{
if(f==-1 && r==-1)
return 1;
else
return 0;
}
void insert(int n)
{
if(overflow())
printf("\n cqueue is full\n");
else
{
if(r==max-1)
r=-1;
else
r++;
queue[r]=n;
if(f==-1)
f=0;
printf("\n%d element is inserted in to queue\n",n);
}
}
void delete()
{
int m;
if(underflow())
printf("\n cqueue is empty\n");
else
{
m=queue[f];
if(f==r)
f=r=-1;
else if(f==max-1)
f=-1;
else
f++;
printf("\n%d element is deleted\n",m);
}
}
void display()
{
int i;
if(underflow())
printf("\n cqueue is empty\n");
else
{
for(i=f;i<=r;i++)
{
printf("%d\t",queue[i]);
} } }

*Program for Single linked list:

#include"stdio.h"
#include"conio.h"
#include"alloc.h"

struct node
{
int info;
struct node *link;
};
char ch;
void main()
{
struct node *first,*newnode,*temp,*temp1;
int op;
do
{
clrscr();
printf("\n 1-create list 2-display 3-insert at first 4-insert in middle \n");
printf("\n 5-insert at last 6-delete from first 7-delete from middle 8-delete from last \n");
printf("\n enter ur option \n");
scanf("%d",&op);
switch(op)
{
case 1 :
{
first=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data\n");
fflush(stdin);
scanf("%d \n", &first->info);
printf("\n would u like to add another(y/n) \n");
fflush(stdin);
ch=getchar();
temp=first;
while(ch=='y' ch=='Y')
{
temp->link=(struct node *)malloc(sizeof(struct node));
temp=temp->link;
printf("\n enter the data \n");
scanf("\n %d",&temp->info);
printf("\n would u like to add another(y/n) \n");
fflush(stdin);
ch=getchar();
}
temp->link=0;
break;
}
case 2 :
{
temp=first;
while(temp!=0)
{
printf("\n %u->%d->%u \n",temp,temp->info,temp->link);
temp=temp->link;
}
break;
}
case 3 :
{
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
newnode->link=first;
first=newnode;
break;
}
case 4 :
{
int x,f=0;
printf("\n enter da position where the new element to b insert b4 that position\n");
scanf("\n%d",&x);
temp=first;
while(temp->link!=0)
{
if(temp->link->info==x)
{
f=1;
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
newnode->link=temp->link;
temp->link=newnode;
break;
}
temp=temp->link;
}
if(f==0)
printf("\n node not found\n");
break;
}
case 5:
{
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
temp=first;
while(temp->link!=0)
temp=temp->link;
temp->link=newnode;
newnode->link=0;
break;
}
case 6 :
{
temp1=first;
first=first->link;
free(temp1);
break;
}
case 7 :
{
int x,f=0;
printf("\n enter the data to b deleted\n");
scanf("\n%d",&x);
temp=first;
while(temp!=0)
{
if(temp->link->info==x)
{
f=1;
temp1=temp->link;
temp->link=temp1->link;
free(temp1);
}
temp=temp->link;
}
if(f==0)
printf("\n node not found\n");
break;
}
case 8 :
{
temp=first;
while(temp->link!=0)
{
temp1=temp;
temp=temp->link;
}
temp1->link=0;
break;
}
}
printf("\n would u like to continue (y/n) \n");
fflush(stdin);
ch=getchar();
}while(ch=='y' ch=='Y');
getch();
}

*Program for circular linked list:
#include"stdio.h"
#include"conio.h"
#include"alloc.h"

struct node
{
int info;
struct node *link;
};
char ch;
void main()
{
struct node *head,*first,*newnode,*temp,*temp1;
int op;
do
{
clrscr();
printf("\n 1-create list 2-display 3-insert at first 4-insert in middle \n");
printf("\n 5-insert at last 6-delete from first 7-delete from middle 8-delete from last \n");
printf("\n enter ur option \n");
scanf("%d",&op);
switch(op)
{
case 1 :
{
head=(struct node *)malloc(sizeof(struct node));
first=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data\n");
fflush(stdin);
scanf("%d \n", &first->info);
head->link=first;
printf("\n would u like to add another(y/n) \n");
fflush(stdin);
ch=getchar();
temp=first;
while(ch=='y' ch=='Y')
{
temp->link=(struct node *)malloc(sizeof(struct node));
temp=temp->link;
printf("\n enter the data \n");
scanf("\n %d",&temp->info);
printf("\n would u like to add another(y/n) \n");
fflush(stdin);
ch=getchar();
}
temp->link=head;
break;
}
case 2 :
{
printf("\n head is at %u\n",head);
temp=first;
while(temp!=head)
{
printf("\n %u->%d->%u \n",temp,temp->info,temp->link);
temp=temp->link;
}
break;
}
case 3 :
{
head->link=first;
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
newnode->link=head->link;
head->link=newnode;
first=newnode;
break;
}
case 4 :
{
int x,f=0;
printf("\n enter da position where the new element to b insert b4 that position\n");
scanf("\n%d",&x);
temp=first;
while(temp->link!=head)
{
if(temp->link->info==x)
{
f=1;
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
newnode->link=temp->link;
temp->link=newnode;
break;
}
temp=temp->link;
}
if(f==0)
printf("\n node not found\n");
break;
}
case 5:
{
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
temp=first;
while(temp->link!=head)
temp=temp->link;
temp->link=newnode;
newnode->link=head;
break;
}
case 6 :
{
temp1=first;
first=first->link;
free(temp1);
break;
}
case 7 :
{
int x,f=0;
printf("\n enter the data to b deleted\n");
scanf("\n%d",&x);
temp=first;
while(temp!=head)
{
if(temp->link->info==x)
{
f=1;
temp1=temp->link;
temp->link=temp1->link;
free(temp1);
}
temp=temp->link;
}
if(f==0)
printf("\n node not found\n");
break;
}
case 8 :
{
temp=first;
while(temp->link!=head)
{
temp1=temp;
temp=temp->link;
}
temp1->link=head;
break;
}
}
printf("\n would u like to continue (y/n) \n");
fflush(stdin);
ch=getchar();
}while(ch=='y' ch=='Y');
getch();
}

*Program for Double linked list:

#include"stdio.h"
#include"conio.h"
#include"alloc.h"
struct node
{
int info;
struct node *prev,*next;
};
char ch;
void main()
{
struct node *first,*newnode,*temp,*temp1;
int op;
do
{
clrscr();
printf("\n 1-create list 2-display 3-insert at first 4-insert in middle \n");
printf("\n 5-insert at last 6-delete from first 7-delete from middle 8-delete from last \n");
printf("\n enter ur option \n");
scanf("%d",&op);
switch(op)
{
case 1 :
{
first=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data\n");
fflush(stdin);
scanf("%d \n", &first->info);
printf("\n would u like to add another(y/n) \n");
fflush(stdin);
ch=getchar();
temp=first;
while(ch=='y' ch=='Y')
{
temp1=temp;
temp->next=(struct node *)malloc(sizeof(struct node));
temp=temp->next;
printf("\n enter the data \n");
scanf("\n %d",&temp->info);
temp->prev=temp1;
printf("\n would u like to add another(y/n) \n");
fflush(stdin);
ch=getchar();
}
temp->next=0;
first->prev=0;
break;
}
case 2 :
{
temp=first;
printf("\n nodeadd prev info next \n");
while(temp!=0)
{
printf("\n\t %u->%u->%d->%u \n",temp,temp->prev,temp->info,temp->next);
temp=temp->next;
}
break;
}
case 3 :
{
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
newnode->prev=0;
newnode->next=first;
first->prev=newnode;
first=newnode;
break;
}
case 4 :
{
int x,f=0;
printf("\n enter da position where the new element to b insert b4 that position\n");
scanf("\n%d",&x);
temp=first;
while(temp->next!=0)
{
if(temp->next->info==x)
{
f=1;
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
newnode->prev=temp;
newnode->next=temp->next;
temp->next->prev=newnode;
temp->next=newnode;
break;
}
temp=temp->next;
}
if(f==0)
printf("\n node not found\n");
break;
}
case 5:
{
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
temp=first;
while(temp->next!=0)
temp=temp->next;
temp->next=newnode;
newnode->prev=temp;
newnode->next=0;
break;
}
case 6 :
{
temp1=first;
first->next->prev=0;
first=first->next;
free(temp1);
break;
}
case 7 :
{
int x,f=0;
printf("\n enter the data to b deleted\n");
scanf("\n%d",&x);
temp=first;
while(temp->next!=0)
{
if(temp->next->info==x)
{
f=1;
temp1=temp->next;
temp->next=temp1->next;
temp1->next->prev=temp;
free(temp1);
}
temp=temp->next;
}
if(f==0)
printf("\n node not found\n");
break;
}
case 8 :
{
temp=first;
while(temp->next!=0)
{
temp1=temp;
temp=temp->next;
}
temp1->next=0;
break;
}
}
printf("\n would u like to continue (y/n) \n");
fflush(stdin);
ch=getchar();
}while(ch=='y' ch=='Y');
getch();
}

*
Program of circular double LL:

#include"stdio.h"
#include"conio.h"
#include"alloc.h"
struct node
{
int info;
struct node *prev,*next;
};
char ch;
void main()
{
struct node *head,*first,*newnode,*temp,*temp1;
int op;
do
{
clrscr();
printf("\n 1-create list 2-display 3-insert at first 4-insert in middle \n");
printf("\n 5-insert at last 6-delete from first 7-delete from middle 8-delete from last \n");
printf("\n enter ur option \n");
scanf("%d",&op);
switch(op)
{
case 1 :
{
head=(struct node *)malloc(sizeof(struct node));
first=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data\n");
fflush(stdin);
scanf("%d \n", &first->info);
head->prev=0;
head->next=first;
printf("\n would u like to add another(y/n) \n");
fflush(stdin);
ch=getchar();
temp=first;
while(ch=='y' ch=='Y')
{
temp1=temp;
temp->next=(struct node *)malloc(sizeof(struct node));
temp=temp->next;
printf("\n enter the data \n");
scanf("\n %d",&temp->info);
temp->prev=temp1;
printf("\n would u like to add another(y/n) \n");
fflush(stdin);
ch=getchar();
}
temp->next=head;
first->prev=head;
break;
}
case 2 :
{
printf("\n head is at %u\n",head);
temp=first;
printf("\n nodeadd->prev->info->next \n");
while(temp!=head)
{
printf("\n %u->%u->%d->%u \n",temp,temp->prev,temp->info,temp->next);
temp=temp->next;
}
break;
}
case 3 :
{
head->next=first;
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
newnode->prev=head;
newnode->next=first;
first->prev=newnode;
first=newnode;
break;
}
case 4 :
{
int x,f=0;
printf("\n enter da position where the new element to b insert b4 that position\n");
scanf("\n%d",&x);
temp=first;
while(temp->next!=0)
{
if(temp->next->info==x)
{
f=1;
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
newnode->prev=temp;
newnode->next=temp->next;
temp->next->prev=newnode;
temp->next=newnode;
break;
}
temp=temp->next;
}
if(f==0)
printf("\n node not found\n");
break;
}
case 5:
{
newnode=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data \n");
scanf("\n %d",&newnode->info);
temp=first;
while(temp->next!=0)
temp=temp->next;
temp->next=newnode;
newnode->prev=temp;
newnode->next=0;
break;
}
case 6 :
{
temp1=first;
first->next->prev=0;
first=first->next;
free(temp1);
break;
}
case 7 :
{
int x,f=0;
printf("\n enter the data to b deleted\n");
scanf("\n%d",&x);
temp=first;
while(temp->next!=0)
{
if(temp->next->info==x)
{
f=1;
temp1=temp->next;
temp->next=temp1->next;
temp1->next->prev=temp;
free(temp1);
}
temp=temp->next;
}
if(f==0)
printf("\n node not found\n");
break;
}
case 8 :
{
temp=first;
while(temp->next!=0)
{
temp1=temp;
temp=temp->next;
}
temp1->next=0;
break;
}
}
printf("\n would u like to continue (y/n) \n");
fflush(stdin);
ch=getchar();
}while(ch=='y' ch=='Y');
getch();
}

*Program for Binary search tree:
#include"stdio.h"
#include"conio.h"
#include"alloc.h"

struct tree
{
int data;
struct tree *lchild,*rchild;
};
void create(struct tree **,int);
void preorder(struct tree *);
void inorder(struct tree *);
void postorder(struct tree *);
void search(struct tree *,int);
void insert(struct tree *,int);
void main()
{
int n,i,x,ch,a;
struct tree *root;
clrscr();
root=NULL;
printf("\n***********************Binary Search Tree*******************\n");
printf("\n\nEnter number of nodes to insert\n");
scanf("%d",&n);
printf("\nEnter elements to create a Binary Search Tree ",n);
for(i=0;idata=x;
temp->lchild=temp->rchild=NULL;
*n=temp;
}
else
{
if(x<(*n)->data)
create(&((*n)->lchild),x);
else
create(&((*n)->rchild),x);
}
}
void preorder(struct tree *n)
{
if(n!=NULL)
{
printf("\t%d",n->data);
preorder(n->lchild);
preorder(n->rchild);
}
}
void inorder(struct tree *n)
{
if(n!=NULL)
{
inorder(n->lchild);
printf("\t%d",n->data);
inorder(n->rchild);
}
}
void postorder(struct tree *n)
{
if(n!=NULL)
{
postorder(n->lchild);
postorder(n->rchild);
printf("\t%d",n->data);
}
}

void search(struct tree *n,int x)
{
int found=0;
struct tree *temp;
temp=n;
while(temp!=0 && !found)
{
if(x==(temp->data))
found=1;
else if(x<(temp->data))
temp=temp->lchild;
else
temp=temp->rchild;
}
if(!found)
printf("\n%d number not found",x);
else
printf("\n%d number found at %u position ",x,temp);
}
void insert(struct tree *n,int x)
{
int found=0;
struct tree *temp,*pred;
temp=n;
while(temp!=0 && !found)
{
pred=temp;
if(x==(temp->data))
found=1;
else if(x<(temp->data))
temp=temp->lchild;
else
temp=temp->rchild;
}
if(!found)
{
temp=(struct tree *)malloc(sizeof(struct tree));
temp->lchild=temp->rchild=0;
temp->data=x;
if(n!=0)
{
if(x<(pred->data))
pred->lchild=temp;
else
pred->rchild=temp;
}
else
n=temp;
}
else
printf("\n%d number already exists ",x);
}

*Program for stack using linked list:

#include"stdio.h"
#include"conio.h"
#include"alloc.h"
struct node
{
int info;
struct node *link;
};
char ch;
int tp=0;
void main()
{
struct node *first,*newnode,*top,*temp;
int op;
clrscr();
printf("\n ********** Program for implementation of stack using linked list *********");
do
{
printf("\n\n\n 1-push 2-pop 3-display 4-exit \n");
printf("\n enter ur option \n\n");
scanf("%d",&op);
switch(op)
{
case 1 :
{
first=(struct node *)malloc(sizeof(struct node));
printf("\n enter the data\n");
scanf("%d",&first->info);
printf("\n would u like to push another(y/n) \n");
fflush(stdin);
ch=getchar();
top=first;
while(ch=='y' ch=='Y')
{
tp++;
if(tp<=5) { top->link=(struct node *)malloc(sizeof(struct node));
top=top->link;
printf("\n enter the data \n");
scanf("\n %d",&top->info);
}
else
{
printf("stack is full,u cant push");
break;
}
printf("\n would u like to push another(y/n) \n");
fflush(stdin);
ch=getchar();
}
top->link=0;
break;
}
case 2 :
{
if(tp==0)
{
printf("\n stack is empty \n");
break;
}
top=first;
while(top->link!=0)
{
temp=top;
top=top->link;
}
temp->link=0;
tp--;
printf("\n poped element is %d \n",top->info);
break;
}
case 3 :
{
if(tp==0)
{
printf("\n stack is empty \n");
}
else
{
top=first;
while(top!=0)
{
printf(" %d \t",top->info);
top=top->link;
}
}
break;
}
case 4 :
{
exit(0);
break;
}
}
printf("\n\n would u like to continue (y/n) \n\n");
fflush(stdin);
ch=getchar();
}while(ch=='y' ch=='Y');
getch();
}

If U hav any queries regarding C,C++, & DS............mail me at
sree.tumma@gmail.com