C Program to find Largest Element in Array in C Programming.

   #include <stdio.h>

int main()


{

    int i,number,largest;


    int arr[100];


    printf("enter the value of array=> ");


    scanf("%d",&number);


              printf("enter the %d value array\n",number);


         for(i=0;i<number;i++)


         scanf("%d\n",&arr[i]);


         largest=0;


        largest=arr[0];


        for(i=0;i<number;i++){


        if(arr[i]>largest){


        largest=arr[i];


        }}

    printf("the largest number is %d",largest);

   return 0;

}


No comments:

Post a Comment

Programming in C Language

  PROGRAM LIST TO BECOME PRO IN C    😍😍😍            PRACTICE SETS                                                        UNIT -1  👇   IN...