Vyom World.com  . Let's Touch the Sky Together!  
. . . . . . .
VyomWorld.com Home
Free Magazines!
VyomLinks.com Home
JobsAssist.com Home
Vyom Network
Contact Us
 Jobs & Careers
Resume Submitter
Placement Papers
IT Companies Directory
Computer Jobs
Interview Questions
Online Exams
Vyom Career eMag.
Screensavers New!
SMS Jokes
 Source Codes Library
Source Codes Home
ASP Source Codes
C Source Codes
C++ Source Codes
COBOL Source Codes
Java Source Codes
Pascal Source Codes
Submit Source Codes
GATE an Overview
GATE Preparation
Study Materal
GRE an Overview
GRE Questions
GRE Preparation
GRE Universities
 TOEFL Preparation
TOEFL Resources
 GMAT Preparation
GMAT Resources
 MBA Preparation
MBA Resources
 Networking Concepts
Networking Concepts
 Testing Preparation
Testing Resources
Free Traffic Builder
Webmaster Articles
Web Hosting
Hardware Tutorial
1500 Free eBooks New!
 FREE Publications
Vyom Career eMag.
Get 9,000+ Interview Questions & Answers in an eBook.

  • 9,000+ Interview Questions
  • All Questions Answered
  • 5 FREE Bonuses
  • Free Upgrades

    Get it now!

    Post your Resume to 5800+ Companies

    Reliable Web Hosting

    Get 9,000+ Interview Questions with Answers in an eBook


    C Source Codes List | Source Code Home
    Program : Stack operations through array.
    /////////////////////////////////////////////////////////////////// // STACK IMPLEMENTATION THROUGH ARRAY // // PUSH . POP // ////////////////////////////////////////////////////////////////// #include <stdio.h> #include<ctype.h> # define MAXSIZE 200 int stack[MAXSIZE]; int top; //index pointing to the top of stack void main() { void push(int); int pop(); int will=1,i,num; clrscr(); printf("\n\t\tProgram for stack demonstration through array by Amit Mathur and Aditya Tiwari.\n\n\n"); while(will ==1) { printf("\n\t\tMAIN MENU: \n\t1.Add element to stack\n\t2.Delete element from the stack\n"); scanf("%d",&will); switch(will) { case 1: printf("\nEnter the data... "); scanf("%d",&num); push(num); break; case 2: i=pop(); printf("\nValue returned from pop function is %d ",i); break; default: printf("Invalid Choice . "); } printf(" \n\n\t\t\tDo you want to do more operations on Stack ( 1 for yes, any other key to exit) "); scanf("%d" , &will); } //end of outer while } //end of main void push(int y) { if(top>MAXSIZE) { printf("\n\n\t\tSTACK FULL\n\n"); return; } else { top++; stack[top]=y; } } int pop() { int a; if(top<=0) { printf("\n\n\t\tSTACK EMPTY\n\n\t\t"); return 0; } else { a=stack[top]; top--; } return(a); }


    C Source Codes List | Source Code Home




    Recently Updated: New Placement Papers added.
    Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Programming & Source Codes | GRE Preparation | Jobs, Discussions | Software Listing | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | International Business Information | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | FAQs | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Excellent Mobiles | Software Testing | Interview Questions | Freshers Jobs | Server Insiders | File Extension Directory

    Copyright ©2003-2018 Vyom Technosoft Pvt. Ltd., All Rights Reserved. Read our Privacy Policy