Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main(){
- int n,j,i,v[30],aux=0,min, max=0;
- printf("introdu n:");
- scanf("%d",&n);
- for(i=0;i<n;i++){
- scanf("%d",&v[i]);
- min = v[i];
- }
- for(int i=0;i<n;i++){
- if(v[i]> max){
- max = v[i];
- }
- }
- for(int i=0;i<n;i++){
- if(v[i] < min){
- min = v[i];
- }
- }
- printf("Minimul este: %d\n", min);
- printf("Maximul este: %d", max);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement