Created
October 6, 2017 04:11
-
-
Save annibuliful/563177ef1410b7ede6cd29c5f9527391 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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