Powered by Blogger.

Translate

Tuesday, June 26, 2012

Home » » array change case C++

array change case C++

#include<stdio.h>
#include<conio.h>
main()
{
  long int n, i, max, a[9999], min;
  printf("how many number?");
  scanf("%d", &n);
  for (i = 0; i<n; i++)
  {
      printf("Enter numbers:");
      scanf("%d", &a[i]);
      }
      max =a[0];
      min =a[0];
      for (i=0; i<n; i++)
      {
          if(a[i]>max)
          max = a[i];
          else if(a[i]<min)
          min = a[i];
          else;
          }
          printf("the greatest number = %d\n", max);
          printf("the smallest number = %d",min);
          fflush(stdin);
          getchar();
          }
         
Share this games :

0 comments:

Post a Comment