{
char str[40];
int i,flag=0,len;
clrscr();
printf("\n Enter A string : ");
gets(str);
len=strlen(str);
for(i=0;i<(len/2);i++)
Posted by Ishani Goel Sunday, June 21, 2009
0 comments Labels: String
Posted by Ishani Goel Friday, June 19, 2009
0 comments Labels: String
Posted by Ishani Goel Thursday, June 18, 2009
Posted by Ishani Goel Monday, June 8, 2009
int a[10],top;
void main()
{
int ch;
clrscr();
top=-1;
while(1)
{
printf("\n\t\t****MENU****\n");
printf("\n 1.Push\n 2.Pop\n 3.Display \n 4.Exit");
printf("\n\n Enter your Choice :");
scanf("%d",&ch);
switch(ch)
{
case 1:
push();
break;
case 2:
pop();
break;
case 3:
display();
break;
case 4:
exit();
}//switch
}//while
}
push()
{
int item;
printf("\n enter The Number You want to push :");
scanf("%d",&item);
if(top==9)
{
printf("\n overflow-You can't push");
}
else
{
top=top+1;
a[top]=item;
}
}//push
pop()
{
int item;
if(top<0) item="a[top];" top="top-1;" i="top;i">=0;i--)
{
printf("\n %d",a[i]);
}
}//display