programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program to Find Smallest Element in the Array

Details
Written by: RajaSekhar
Category: C Programs
  • Arrays in C
  • smallest
  • array
  • element
#include<stdio.h>
#include<conio.h>
void main()
{
    int a[30],i,n,small;

    printf(" Enter Number of Elements in Array :");
    scanf("%d",&n);

    /* Read Elements in an array  */
    printf(" \n Enter the Elements: ");
    for(i=0 ; i < n ; i++)
        scanf("%d",&a[i]);

    small = a[0];

    for(i = 0 ; i < n ; i++)
    {
        if ( a[i] < small )
            small = a[i];
    }

    printf(" Smallest Element in the Array is : %d",small);

    getch();
}

 OUTPUT:

 Enter Number of Elements in Array :5

 Enter the Elements: 1
3
2
6
5
 Smallest Element in the Array is : 1
Previous article: C Program for Matrix Multiplication Prev Next article: C Program to Find Radius and Circumference of a Circle Next
  • C Program for MERGING of Two Arrays with out using Third Array
  • C Program to Implement Structure with Array
  • C Program to Print Addresses of Variables
  • Page Replacement Programs in C
  • C Program to Find Biggest of Two Numbers using Ternary
  • C Program to Perform Arithmetic Operations Using Switch
  • C Program Example to Initialize Structure Variable
  • C Program for Finding Factorial of a Number
  • Swap Two Static Numbers Using C
  • C Program to Find Sum of Odd Integers
  • C Program to Find Address locations of Array Elements Using Pointers
  • C Program for Fibonacci Series using While Loop
  • C Program to Print Pyramid of Numbers
  • C Program to Implement Call By Value using Functions
  • C Program to Find Length of a String Using STRLEN()
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top