#include<stdio.h> #include <stdbool.h> #define max_size 100 int arr[max_size], top = -1; bool isFull() { if(top == (max_size - 1)){ printf("Stack is Full!!\n"); return true; }else{ printf("Stack is Not Full!!!. You can insert Value!!\n"); return false; } } bool isempty(){ if(top == -1){ return true; }else{ return false; } } void push() { if(isFull()){ printf("Stack is Full!!\n"); }else{ int value; printf("Enter the value: "); scanf("%d", &value); top++; arr[top] = value; printf("%d is inserted into stack.\n", value); } } void pop() { if(isempty()){ printf("\nStack is Empty!!\n"); } else{ int value = arr[top]; printf("%d is popped.\n", value); top = top - 1; } } void stack_size() { printf("Size of the array is: %d.\n", top + 1); } void print_arr() { printf("Array Elements are: "); for(int i = 0; i < (top + 1); i++){ printf("%d ", arr[i]); } printf("\n\n"); } int main() { int n; while(1){ printf("Press 1 for push 2 for pop 3 for array elements 4 for size: "); scanf("%d", &n); switch(n){ case 1: push(); break; case 2: pop(); break; case 3: print_arr(); break; case 4: stack_size(); break; } } return 0; }
Full Stack Implementation in C programming language
By
Alamgir Hossain
C
Click any Bellow Tabs/Tags
Alamgir-Hossain
(14)
Algorithms
(5)
Android problem
(2)
ANN
(1)
ArticleWriting
(26)
Artificial Intelligence
(1)
Assembly
(1)
Bangla Love Poem
(3)
Bangla Poem
(2)
best programming solution
(9)
Books
(2)
BUET IICT MSC Admission
-2021
(1)
C
(49)
Campus
(7)
CPP
(88)
Database
(4)
Differences
(2)
Fishing
(1)
HSC
(1)
Html
(4)
interesting programming solution
(9)
Interview
(2)
It job preparation
(7)
JAVA
(97)
JavaScript
(5)
JSON
(1)
lead generation
(1)
machine learning
(2)
ML Projects
(3)
NewsPaper
(19)
Others
(13)
Perl
(23)
Php
(4)
Poem
(4)
Presentation
(1)
ProblemSolving
(3)
Project
(21)
Prolog
(13)
Python
(33)
research
(18)
Research Tool
(1)
Security
(3)
Social Engineering
(1)
Testimonials
(5)
Tutorial
(2)
Writings
(15)
XML
(1)
YoutubeSEO
(1)
উক্তি
(1)
কবিতা-আলগীর হোসেন
(2)
লেখনী
(33)
LATEST
3-latest-65px
Popular Posts
-
All instructions for connection & insert data in mysql from java JSP and Servlet using tomcat serverFrom this tutorial you can learn about... All instructions for connection & insert data in mysql from java JSP and Servlet using tomc...
-
% Prolog program for addition and multplication-------- % Alamgir Hossain % CSE, JUST go :- write ( 'Enter first number : ' ...
-
Inverse Lagrange’s Interpolation Formula Theory : . Example : 1. Use Lagrange’s inverse interpolation fo...
-
Project Name : Online examination system. Framework : MVC framework in java(3 layer architecture). Language: JAVA JSP, SERVLET, JS...
-
Here is the source code for online exam system using PHP, MYSQL,AJAX, JAVASCRIPT etc.... Source code for Online Exam System
sauna supplies
ReplyDeleteWAJA sauna is specialist manufacturer of top quality sauna products. Products include sauna rooms, steam rooms, barrel saunas, wooden hot tubs, and all kinds of sauna accessories.
Caesars Casino: Now Open | JamBase
ReplyDeleteWelcome 제주 출장샵 to JamBase! Experience our newly 논산 출장마사지 opened casino in Murphy, 계룡 출장안마 North Carolina. 동두천 출장마사지 We are open 24/7. Casino is one of the largest 남원 출장샵 in North