Vision and dreams are the blueprints of soul and achievements.
-Mohammed Ahmed F

Largest among n digit

    #include<stdio.h> 
    #include<conio.h> 
    void main() 
    { 
      int max_num(int a[],int n); 
      int max,i,n; 
      int a[50]; 
      clrscr(); 
      printf("Enter n number:"); 
      scanf("%d",&n); 
      printf("Enter the numbers:"); 
      for(i=0;i<n;i++) 
      scanf("%d",&a[i]); 
      max=max_num(a,n); 
      printf("The largest number is %d",max); 
      getch(); 
   } 
    int max_num(int a[],int n) 
    { 
      int i,m=0; 
      for(i=0;i<n;i++) 
      { 
        if(a[i]>m) 
          m=a[i]; 
      } 
      return m; 
   }

Share this

Related Posts

Dear User,

Thank you for your comment. Hope you like this blog. Kindly share us on Social Media so others can be updated.

-Chief Administrative Officer.