srm elab daa

Sunday, February 9, 2020

MIN MAX

#include <stdio.h>
int main()
{
int a,b[10],i,max=0,min=100;
  
  scanf("%d",&a);
  for(i=0;i<a;i++) 
  { 
    scanf("%d",&b[i]);
  } 
    for(i=0;i<a;i++) 
    { 
      if(min>b[i]) { min=b[i];} 
            if(max<b[i]) { max=b[i];} 
    } 
  printf("Minimum element in an array : %d\n",min);
  printf("Maximum element in an array : %d",max);
 return 0;
}
Posted by blogger at 3:16 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

About Me

blogger
View my complete profile

Blog Archive

  • ▼  2020 (47)
    • ►  January (11)
    • ▼  February (36)
      • PERMUTING TWO ARRAYS
      • Chandu and his Girlfriend
      • Problem of closest pair of points
      • Closest Pair of Points
      • Benny and Gifts
      • MIN MAX
      • Shil and Lucky String
      • Monk’s School.
      • Closest pair of points problem
      • Charsi in Love
      • Game Of Strengths
      • Mutual Smallest Distance
      • Sort me this way !
      • Strassen Algorithm
      • Counting Triangles
      • Match makers
      • Bishu and Soldiers
      • Missing Soldiers
      • The Enlightened Ones
      • SHERLOCK AND THE BEAST
      • HUNGER GAMES
      • MARK & TOYS
      • CHOOSING THE JUDGES
      • STUDIOUS LITTLE JHOOL
      • The colorful street
      • THE MAXIMUM SUB ARRAY
      • LET'S BEGIN!
      • MAGICAL WORDS
      • Minimum number
      • Rectangular Land
      • SUPER TWO LETTER STRINGS
      • Knight Walk
      • Possible paths
      • Alphabets
      • string
      • Numbers
Picture Window theme. Powered by Blogger.