SlideShare a Scribd company logo
1 of 9
/* Write C programs that implement stack (its operations) using i) Arrays */



#include<stdio.h>

#include<conio.h>



int st_arr[20];

int t=-1;



void push_ele(int ele);

int pop_ele();

void display_ele();



void main()

{

    char choice,num1=0,num2=0;

    while(1)

    {

        clrscr();

        printf("======================================");

        printf("ntt MENU ");

        printf("n======================================");

        printf("n[1] Using Push Function");

        printf("n[2] Using Pop Function");

        printf("n[3] Elements present in Stack");
printf("n[4] Exitn");

printf("ntEnter your choice: ");

fflush(stdin);

scanf("%c",&choice);



switch(choice-'0')

{



    case 1:

    {

         printf("ntElement to be pushed: ");

         scanf("%d",&num1);

         push_ele(num1);

         break;

    }



    case 2:

    {

         num2=pop_ele(1);

         printf("ntElement to be popped: %dnt",num2);

         getch();

         break;

    }
case 3:

            {

                 display_ele();

                 getch();

                 break;

            }



            case 4:

                 exit(1);

                 break;



            default:

                 printf("nYour choice is invalid.n");

                 break;

        }

    }

}



/*Implementing the push() function. */

void push_ele(int ele)

{

    if(t==99)

    {

        printf("STACK is Full.n");
getch();

        exit(1);

    }

    st_arr[++t]=ele;

}



/*Implementing the pop() function. */

int pop_ele()

{

    int ele1;

    if(t==-1)

    {

        printf("ntSTACK is Empty.n");

        getch();

        exit(1);

    }

    return(st_arr[t--]);

}



/*Implementing display() function. */

void display_ele()

{

    int k;

    printf("ntElements present in the stack are:nt");
for(k=0;k<=t;k++)

    printf("%dt",st_arr[k]);

}



/* Write C programs that implement stack (its operations) using ii) Pointers */



#include<stdio.h>

#include<conio.h>



struct st_point

{

    int ele;

    struct st_point *l;

}



*t;

int i;



void push_ele(int j);

int pop_ele();

void display_ele();



void main()

{
char choice,num1=0,num2=0;

int i;

while(1)

{

    clrscr();

    printf("======================================");

    printf("ntt MENU ");

    printf("n======================================");

    printf("n[1] Using Push Function");

    printf("n[2] Using Pop Function");

    printf("n[3] Elements present in Stack");

    printf("n[4] Exitn");

    printf("ntEnter your choice: ");

    fflush(stdin);

    scanf("%c",&choice);



    switch(choice-'0')

    {

        case 1:

        {

             printf("ntElement to be pushed:");

             scanf("%d",&num1);

             push_ele(num1);

             break;
}



case 2:

{

     num2=pop_ele(1);

     printf("ntElement to be popped: %dnt",num2);

     getch();

     break;

}



case 3:

{

     printf("ntElements present in the stack are:nt");

     display_ele();

     getch();

     break;

}



case 4:

     exit(1);

     break;



default:

     printf("nYour choice is invalid.n");
break;

        }

    }

}



/*Inserting the elements using push function*/

void push_ele(int j)

{

    struct st_point *m;

    m=(struct st_point*)malloc(sizeof(struct st_point));

    m->ele=j;

    m->l=t;

    t=m;

    return;

}



/*Removing the elements using pop function*/

int pop_ele()

{

    if(t==NULL)

    {

        printf("nSTACK is Empty.");

        getch();

        exit(1);
}

    else

    {

        int i=t->ele;

        t=t->l;

        return (i);

    }

return 0;

}



/*Displaying the elements */

void display_ele()

{

    struct st_point *pointer=NULL;

    pointer=t;

    while(pointer!=NULL)

    {

        printf("%dt",pointer->ele);

        pointer=pointer->l;

    }

}

More Related Content

What's hot

Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04
hassaanciit
 

What's hot (20)

week-18x
week-18xweek-18x
week-18x
 
Final ds record
Final ds recordFinal ds record
Final ds record
 
week-10x
week-10xweek-10x
week-10x
 
week-1x
week-1xweek-1x
week-1x
 
C program to implement linked list using array abstract data type
C program to implement linked list using array abstract data typeC program to implement linked list using array abstract data type
C program to implement linked list using array abstract data type
 
Recursion concepts by Divya
Recursion concepts by DivyaRecursion concepts by Divya
Recursion concepts by Divya
 
Array list
Array listArray list
Array list
 
C Programming Language Part 9
C Programming Language Part 9C Programming Language Part 9
C Programming Language Part 9
 
Array menu
Array menuArray menu
Array menu
 
Avl tree
Avl treeAvl tree
Avl tree
 
Stack concepts by Divya
Stack concepts by DivyaStack concepts by Divya
Stack concepts by Divya
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7
 
C Programming Language Part 8
C Programming Language Part 8C Programming Language Part 8
C Programming Language Part 8
 
Trabajo Scilab
Trabajo ScilabTrabajo Scilab
Trabajo Scilab
 
Ejercicios Scilab Completo
Ejercicios Scilab CompletoEjercicios Scilab Completo
Ejercicios Scilab Completo
 
Taller De Scilab
Taller De ScilabTaller De Scilab
Taller De Scilab
 
Understanding storage class using nm
Understanding storage class using nmUnderstanding storage class using nm
Understanding storage class using nm
 
Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04
 
C Programming Language Part 11
C Programming Language Part 11C Programming Language Part 11
C Programming Language Part 11
 
Qprgs
QprgsQprgs
Qprgs
 

Viewers also liked

Unit7 jwfiles
Unit7 jwfilesUnit7 jwfiles
Unit7 jwfiles
mrecedu
 
Vatesh
VateshVatesh
Vatesh
vatesh
 
Queue and stacks
Queue and stacksQueue and stacks
Queue and stacks
grahamwell
 
Ds lab manual by s.k.rath
Ds lab manual by s.k.rathDs lab manual by s.k.rath
Ds lab manual by s.k.rath
SANTOSH RATH
 

Viewers also liked (17)

Data Structure Project File
Data Structure Project FileData Structure Project File
Data Structure Project File
 
Programs
ProgramsPrograms
Programs
 
Algo>Stacks
Algo>StacksAlgo>Stacks
Algo>Stacks
 
Hargun
HargunHargun
Hargun
 
Unit7 jwfiles
Unit7 jwfilesUnit7 jwfiles
Unit7 jwfiles
 
week-20x
week-20xweek-20x
week-20x
 
07 A1 Ec01 C Programming And Data Structures
07 A1 Ec01 C Programming And Data Structures07 A1 Ec01 C Programming And Data Structures
07 A1 Ec01 C Programming And Data Structures
 
Vatesh
VateshVatesh
Vatesh
 
Stacks,queues,linked-list
Stacks,queues,linked-listStacks,queues,linked-list
Stacks,queues,linked-list
 
Unit ii(dsc++)
Unit ii(dsc++)Unit ii(dsc++)
Unit ii(dsc++)
 
Queue and stacks
Queue and stacksQueue and stacks
Queue and stacks
 
ch6
ch6ch6
ch6
 
BrainFingerprintingpresentation
BrainFingerprintingpresentationBrainFingerprintingpresentation
BrainFingerprintingpresentation
 
Ds lab manual by s.k.rath
Ds lab manual by s.k.rathDs lab manual by s.k.rath
Ds lab manual by s.k.rath
 
DISTRIBUTED INTERACTIVE VIRTUAL ENVIRONMENT
DISTRIBUTED INTERACTIVE VIRTUAL ENVIRONMENTDISTRIBUTED INTERACTIVE VIRTUAL ENVIRONMENT
DISTRIBUTED INTERACTIVE VIRTUAL ENVIRONMENT
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 
PPT (2)
PPT (2)PPT (2)
PPT (2)
 

Similar to week-15x

Datastructures asignment
Datastructures asignmentDatastructures asignment
Datastructures asignment
sreekanth3dce
 
operating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdfoperating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdf
aptcomputerzone
 
Given an expression string exp, write a java class ExpressionCheccke.pdf
Given an expression string exp, write a java class ExpressionCheccke.pdfGiven an expression string exp, write a java class ExpressionCheccke.pdf
Given an expression string exp, write a java class ExpressionCheccke.pdf
info382133
 
BINARY SEARCH TREE OPERATIONS #includestdio.h#includestdlib.pdf
BINARY SEARCH TREE OPERATIONS #includestdio.h#includestdlib.pdfBINARY SEARCH TREE OPERATIONS #includestdio.h#includestdlib.pdf
BINARY SEARCH TREE OPERATIONS #includestdio.h#includestdlib.pdf
ARYAN20071
 
Can you give an example of a binary heap programCan you give an .pdf
Can you give an example of a binary heap programCan you give an .pdfCan you give an example of a binary heap programCan you give an .pdf
Can you give an example of a binary heap programCan you give an .pdf
arorasales234
 
DATA STRUCTURE USING C & C++
DATA STRUCTURE USING C & C++DATA STRUCTURE USING C & C++
DATA STRUCTURE USING C & C++
mustkeem khan
 
operating system Linux,ubuntu,Mac#include stdio.h #include .pdf
operating system Linux,ubuntu,Mac#include stdio.h #include .pdfoperating system Linux,ubuntu,Mac#include stdio.h #include .pdf
operating system Linux,ubuntu,Mac#include stdio.h #include .pdf
aquazac
 
#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf
asif1401
 

Similar to week-15x (20)

#C programming Question 35Implement the functions required for the.docx
#C programming Question 35Implement the functions required for the.docx#C programming Question 35Implement the functions required for the.docx
#C programming Question 35Implement the functions required for the.docx
 
Datastructures asignment
Datastructures asignmentDatastructures asignment
Datastructures asignment
 
week-17x
week-17xweek-17x
week-17x
 
Stack prgs
Stack prgsStack prgs
Stack prgs
 
VTU DSA Lab Manual
VTU DSA Lab ManualVTU DSA Lab Manual
VTU DSA Lab Manual
 
operating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdfoperating system ubuntu,linux,MacProgram will work only if you g.pdf
operating system ubuntu,linux,MacProgram will work only if you g.pdf
 
Given an expression string exp, write a java class ExpressionCheccke.pdf
Given an expression string exp, write a java class ExpressionCheccke.pdfGiven an expression string exp, write a java class ExpressionCheccke.pdf
Given an expression string exp, write a java class ExpressionCheccke.pdf
 
VTU Data Structures Lab Manual
VTU Data Structures Lab ManualVTU Data Structures Lab Manual
VTU Data Structures Lab Manual
 
BINARY SEARCH TREE OPERATIONS #includestdio.h#includestdlib.pdf
BINARY SEARCH TREE OPERATIONS #includestdio.h#includestdlib.pdfBINARY SEARCH TREE OPERATIONS #includestdio.h#includestdlib.pdf
BINARY SEARCH TREE OPERATIONS #includestdio.h#includestdlib.pdf
 
Can you give an example of a binary heap programCan you give an .pdf
Can you give an example of a binary heap programCan you give an .pdfCan you give an example of a binary heap programCan you give an .pdf
Can you give an example of a binary heap programCan you give an .pdf
 
DATA STRUCTURE USING C & C++
DATA STRUCTURE USING C & C++DATA STRUCTURE USING C & C++
DATA STRUCTURE USING C & C++
 
DSU C&C++ Practical File Diploma
DSU C&C++ Practical File DiplomaDSU C&C++ Practical File Diploma
DSU C&C++ Practical File Diploma
 
stack.pptx
stack.pptxstack.pptx
stack.pptx
 
CS8391-Data Structures Unit 2
CS8391-Data Structures Unit 2CS8391-Data Structures Unit 2
CS8391-Data Structures Unit 2
 
DS- Stack ADT
DS- Stack ADTDS- Stack ADT
DS- Stack ADT
 
operating system Linux,ubuntu,Mac#include stdio.h #include .pdf
operating system Linux,ubuntu,Mac#include stdio.h #include .pdfoperating system Linux,ubuntu,Mac#include stdio.h #include .pdf
operating system Linux,ubuntu,Mac#include stdio.h #include .pdf
 
DataStructures notes
DataStructures notesDataStructures notes
DataStructures notes
 
C program
C programC program
C program
 
Data structure circular list
Data structure circular listData structure circular list
Data structure circular list
 
#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf#includeiostream#includestdlib.husing namespace std;class .pdf
#includeiostream#includestdlib.husing namespace std;class .pdf
 

More from KITE www.kitecolleges.com (20)

ch14
ch14ch14
ch14
 
ch16
ch16ch16
ch16
 
holographic versatile disc
holographic versatile discholographic versatile disc
holographic versatile disc
 
week-22x
week-22xweek-22x
week-22x
 
week-5x
week-5xweek-5x
week-5x
 
week-6x
week-6xweek-6x
week-6x
 
week-3x
week-3xweek-3x
week-3x
 
ch8
ch8ch8
ch8
 
Intro Expert Systems test-me.co.uk
Intro Expert Systems test-me.co.ukIntro Expert Systems test-me.co.uk
Intro Expert Systems test-me.co.uk
 
ch17
ch17ch17
ch17
 
ch4
ch4ch4
ch4
 
week-7x
week-7xweek-7x
week-7x
 
week-9x
week-9xweek-9x
week-9x
 
week-14x
week-14xweek-14x
week-14x
 
AIRBORNE
AIRBORNEAIRBORNE
AIRBORNE
 
ch2
ch2ch2
ch2
 
week-23x
week-23xweek-23x
week-23x
 
week-2x
week-2xweek-2x
week-2x
 
ch3
ch3ch3
ch3
 
Entity Classes and Attributes
Entity Classes and AttributesEntity Classes and Attributes
Entity Classes and Attributes
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

week-15x

  • 1. /* Write C programs that implement stack (its operations) using i) Arrays */ #include<stdio.h> #include<conio.h> int st_arr[20]; int t=-1; void push_ele(int ele); int pop_ele(); void display_ele(); void main() { char choice,num1=0,num2=0; while(1) { clrscr(); printf("======================================"); printf("ntt MENU "); printf("n======================================"); printf("n[1] Using Push Function"); printf("n[2] Using Pop Function"); printf("n[3] Elements present in Stack");
  • 2. printf("n[4] Exitn"); printf("ntEnter your choice: "); fflush(stdin); scanf("%c",&choice); switch(choice-'0') { case 1: { printf("ntElement to be pushed: "); scanf("%d",&num1); push_ele(num1); break; } case 2: { num2=pop_ele(1); printf("ntElement to be popped: %dnt",num2); getch(); break; }
  • 3. case 3: { display_ele(); getch(); break; } case 4: exit(1); break; default: printf("nYour choice is invalid.n"); break; } } } /*Implementing the push() function. */ void push_ele(int ele) { if(t==99) { printf("STACK is Full.n");
  • 4. getch(); exit(1); } st_arr[++t]=ele; } /*Implementing the pop() function. */ int pop_ele() { int ele1; if(t==-1) { printf("ntSTACK is Empty.n"); getch(); exit(1); } return(st_arr[t--]); } /*Implementing display() function. */ void display_ele() { int k; printf("ntElements present in the stack are:nt");
  • 5. for(k=0;k<=t;k++) printf("%dt",st_arr[k]); } /* Write C programs that implement stack (its operations) using ii) Pointers */ #include<stdio.h> #include<conio.h> struct st_point { int ele; struct st_point *l; } *t; int i; void push_ele(int j); int pop_ele(); void display_ele(); void main() {
  • 6. char choice,num1=0,num2=0; int i; while(1) { clrscr(); printf("======================================"); printf("ntt MENU "); printf("n======================================"); printf("n[1] Using Push Function"); printf("n[2] Using Pop Function"); printf("n[3] Elements present in Stack"); printf("n[4] Exitn"); printf("ntEnter your choice: "); fflush(stdin); scanf("%c",&choice); switch(choice-'0') { case 1: { printf("ntElement to be pushed:"); scanf("%d",&num1); push_ele(num1); break;
  • 7. } case 2: { num2=pop_ele(1); printf("ntElement to be popped: %dnt",num2); getch(); break; } case 3: { printf("ntElements present in the stack are:nt"); display_ele(); getch(); break; } case 4: exit(1); break; default: printf("nYour choice is invalid.n");
  • 8. break; } } } /*Inserting the elements using push function*/ void push_ele(int j) { struct st_point *m; m=(struct st_point*)malloc(sizeof(struct st_point)); m->ele=j; m->l=t; t=m; return; } /*Removing the elements using pop function*/ int pop_ele() { if(t==NULL) { printf("nSTACK is Empty."); getch(); exit(1);
  • 9. } else { int i=t->ele; t=t->l; return (i); } return 0; } /*Displaying the elements */ void display_ele() { struct st_point *pointer=NULL; pointer=t; while(pointer!=NULL) { printf("%dt",pointer->ele); pointer=pointer->l; } }