- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
4 Posted Topics
what excatly you want Byte Alignment or do you want to check whether address are in consecutive positions ?
[CODE] #include<stdio.h> #include<conio.h> int MAX(int []); int main() { int arr[5]={1,2,45,36,65}; int max=MAX(arr); printf("MAx=%d",max); return 0; } int MAX(int a[]) { int i,j; for(i=0;i<5;i++) { for(j=i+1;j<5;j++) { if(a[i]>a[j]) { a[i]=a[i]+a[j]; a[j]=a[i]-a[j]; a[i]=a[i]-a[j]; //swapping } } } return a[4]; } [/CODE] THIS IS WORKING :):)
Intel Advertisement sometimes blocks the pop up coming from Menu!! it overlaps the pop up please check it !
you want it for static array or dynamic array !! here is algorithm for you 1. ask user what he wants to do push or pop 2.in pop check whether stack is empty or not if not then pop the last value in stack and decrement the stack count else …
The End.