Skip to content

Instantly share code, notes, and snippets.

@annibuliful
Created October 6, 2017 04:11
Show Gist options
  • Save annibuliful/563177ef1410b7ede6cd29c5f9527391 to your computer and use it in GitHub Desktop.
Save annibuliful/563177ef1410b7ede6cd29c5f9527391 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include<stdlib.h>
#include<time.h>
int main(){
int number[100];
int i;
int Minimum , Maximum;
srand ( time(NULL) );
for(i = 0 ; i < 100 ;i++){
number[i] = rand() % 50 + 1;
printf("%d " , number[i]);
}
Maximum = number[0];
for(i = 0 ; i < 100 ; i++){
if(Maximum < number[i]){
Maximum = number[i];
}
}
printf("\nMaximum number is %d \n",Maximum);
Minimum = number[0];
for(i = 0 ; i < 100 ; i++){
if(Minimum > number[i]){
Minimum = number[i];
}
}
printf("Minimum number is %d\n",Minimum);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment