code

in #code6 years ago

#include <stdio.h>
#include <conio.h>

int main(){
int inputArray[500], elementCount, counter, max, min;

printf("Enter Number of Elements in Array\n");
scanf("%d", &elementCount);
printf("Enter %d numbers \n", elementCount);
 
/* Read array elements */
for(counter = 0; counter < elementCount; counter++){
    scanf("%d", &inputArray[counter]);
}
 
max = min = inputArray[0];
for(counter = 1; counter < elementCount; counter++){
    if(inputArray[counter] > max)
        max = inputArray[counter];
    else if(inputArray[counter] < min)
        min = inputArray[counter];
}
 
printf("Maximum Element : %d\n", max);
printf("Minimum Element : %d", min);
      
getch();
return 0;

}

Sort:  

Congratulations @redoan! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You made your First Vote
You published your First Post

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

By upvoting this notification, you can help all Steemit users. Learn how here!

Coin Marketplace

STEEM 0.28
TRX 0.12
JST 0.033
BTC 69692.63
ETH 3775.19
USDT 1.00
SBD 3.76