Blog Moved

This website completely moved to new domain. For latest content, visit www.programmingposts.com

Search This Blog

6 May 2013

C PROGRAM TO FIND LARGEST AND SMALLEST NUMBER IN AN ARRAY

C PROGRAM TO FIND LARGEST AND SMALLEST NUMBER IN AN ARRAY

#include<stdio.h>
#define MAX 25 //maximum size of array is 25

main()
{
  int i,n,LargeNo,SmallNo,arr[MAX];

  printf(" *** C PROGRAMS BLOG ***");
  printf("\n >>> Program to find Largest element in array <<<");
  printf("\n\n Enter the size of array: ");
  scanf("%d",&n); //taking size of array as input from user
  printf("\n Enter the %d elements of array: \n",n);
  
  //taking input all the elements of array using for loop
  for(i=0;i<n;i++)
  {
   printf("\n arr[%d]:",i+1);
   scanf("%d",&arr[i]);    
  }
   LargeNo = arr[0];
   SmallNo = arr[0];
   for(i=0;i<n;i++)
   {
    //checking for Largest Number
    if(arr[i]>LargeNo)
    {
     LargeNo = arr[i];
    }
    //checking for Smallest Number
    if(arr[i]<SmallNo)
    {
     SmallNo = arr[i];
    }
   }
  //printing the largest and Smallst elements in array
  printf("\n The Largest Element in the Array is: %d ",LargeNo);
  printf("\n The Smallest Element in the Array is: %d ",SmallNo);
  getch();
}

Sample Output :

86 comments:

  1. Replies
    1. IEEE Final Year Project centers make amazing deep learning final year projects ideas for final year students Final Year Projects for CSE to training and develop their deep learning experience and talents.

      IEEE Final Year projects Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation.

      corporate training in chennai corporate training in chennai

      corporate training companies in india corporate training companies in india

      corporate training companies in chennai corporate training companies in chennai

      I have read your blog its very attractive and impressive. I like it your blog. Digital Marketing Company in Chennai

      Delete
  2. Good
    Here is a link for C/C++ programs and pointer programs. This may be useful for you.

    C/C++ Programs

    ReplyDelete
  3. This blog awesome and i learn a lot about programming from here.The best thing about this blog is that you doing from beginning to experts level.

    Love from

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. how can made pascal triangle in c programming

    ReplyDelete
  6. This blog awesome and i learn a lot about programming from here.The best thing about this blog is that you doing from beginning to experts level.

    Love from

    ReplyDelete
  7. hi.its really awesome blog.thank you for sharing this blog.
    Salesforce Training

    ReplyDelete
  8. actually it was an awesome blog.thank you for sharing this.its really informative to me.
    C Programming Training

    ReplyDelete
  9. hi its really awesome blog.thank you for sharing this blog.
    C Programming Training

    ReplyDelete
  10. Very Informative! This blog is great source of information which is very useful for me. eCommerce Solution Provider India

    ReplyDelete
  11. really nice blog about c. c is the base for java. if you clear about c then learning of java is very simple to you. for best java training in chennai reach us at TIA academy

    ReplyDelete
  12. I have read your blog and i got a very useful and knowledgeable information from your blog.You have done a great job . If anyone want Java Training in Chennai, Please visit our page
    Java Training in Chennai

    ReplyDelete
  13. Very Useful information that i have found. don't stop sharing and Please keep updating us..... Thanks

    ReplyDelete
  14. I have read your blog very clearly. I got lot of useful information from this blog.You have good coding knowledge. keep sharing more blogs like this type of coading. Thanks for sharing.


    Software Testing Training in Chennai

    ReplyDelete
  15. Nice tutorial. Thanks for sharing the valuable info about c Training. it’s really helpful. Who want to learn c language this blog most helpful. Keep sharing on updated tutorials…..

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. Nice tutorial. to learn more c programming visit here.

    ReplyDelete
  18. Nice blog, thanks for sharing useful information.

    ReplyDelete
  19. Thanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital informationC Programming Training in Chennai

    ReplyDelete
  20. This information is impressive; I am inspired by your post writing style & how continuously you describe this topic.... Java Training in Chennai | Blue prism Training in Chennai

    ReplyDelete
  21. PemainBandarQ - Agen Poker dan Domino Terpercaya dan Terbesar se-Indonesia 100% no bot no admin

    Yuk bergabung bersama kami di PemainBandarQ!! Dengan 1 User ID
    Anda dapat akses ke 8 permainan terbaik se-Indonesia. Dengan Minimal DEPO&WD hanya Rp. 15.000,-. Anda bisa memenangkan sampai PULUHAN JUTA rupiah.

    Dengan 1 User ID anda bisa akses ke 8 permainan:
    *Poker
    *AduQ
    *DominoQQ
    *BandarQ
    *BandarPoker
    *BandarSakong
    *CapsaSusun
    *BANDAR66
    Nikmati juga bonus yang kami sediakan, diantaranya :
    -Bonus TurnOver Sebesar 0.5% Yang dibagikan Setiap Hari !!!
    -Bonus Referral Seumur Hidup sebesar 20%

    Untuk mempermudah transaksi member, Kami menyediakan 5 Bank Terbaik se- Indonesia : BCA, BNI, BRI, Mandiri, Danamon

    Yuk langsung aja daftarkan diri anda di :
    https://goo.gl/kafuCC

    Untuk info lebih lanjut silahkan kunjungi Customer Service kami di :
    LiveChat : https://goo.gl/P4fHDo
    PIN BBM : 2BF939F6
    SKYPE : PemainBandarQ
    Facebook : https://goo.gl/cukg3u
    Twitter : @Pemainbandarq

    ReplyDelete
  22. Thanks for sharing this post. Your post is really very helpful its students.

    DevOps Online Training

    ReplyDelete
  23. If You are looking for java programs we have it at our Blog Please have a look https://letml.blogspot.com/2019/02/inheritancejavaoopconcepts.html

    ReplyDelete
  24. Numpang izin promo ya kk / cc admin ^^

    Ayo mari sini join dan daftarkan diri anda bersama kami BandarJudiQQ, Situs Poker dan Domino Terhebat
    BandarJudiQQ ?? https://goo.gl/S4ETMA

    Minimal Deposit & Withdraw IDR 15.000
    Bonus TurnOver 0.3 % - 0.5 %
    Bonus Referral 20 %
    Dan mainkan ke 8 Game Hanya dengan 1 ID

    Tunggu apalagi ayo segera join BandarJudiQQ
    Register : BandarJudiQQ


    Bila anda mempunyai pertanyaan langsung saja hubungi kami via :
    LiveChat : https://goo.gl/noSSC9
    BBM : 336057ED
    YM : bandarjudiqq@yahoo.com
    Twitter :@bandarjudiqq



    BandarJudiQQ

    ReplyDelete
  25. Numpang izin promo ya kk / cc admin ^^

    Ayo mari sini join dan daftarkan diri anda bersama kami BandarJudiQQ, Situs Poker dan Domino Terhebat
    BandarJudiQQ ?? https://goo.gl/S4ETMA

    Minimal Deposit & Withdraw IDR 15.000
    Bonus TurnOver 0.3 % - 0.5 %
    Bonus Referral 20 %
    Dan mainkan ke 8 Game Hanya dengan 1 ID

    Tunggu apalagi ayo segera join BandarJudiQQ
    Register : BandarJudiQQ


    Bila anda mempunyai pertanyaan langsung saja hubungi kami via :
    LiveChat : https://goo.gl/noSSC9
    BBM : 336057ED
    YM : bandarjudiqq@yahoo.com
    Twitter :@bandarjudiqq



    BandarJudiQQ

    ReplyDelete
  26. This article is very useful for us but please deep discuss about for(;;) for loop in c and also provide excecution flow of for(;;) loop

    ReplyDelete
  27. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.Surya Informatics

    ReplyDelete
  28. What a content


    https://wethecoders.com/csharp-programming-assignment-help
    https://wethecoders.com/about-us
    https://wethecoders.com/android-project-ideas-android-programming-android-assignment-help
    https://wethecoders.com/asp-net-mcv-assignment-help/

    ReplyDelete
  29. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    top angular js online training

    ReplyDelete
  30. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    workday studio online training
    best workday studio online training
    top workday studio online training

    ReplyDelete
  31. I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.

    aws training videos

    ReplyDelete
  32. Great efforts put to publish these kinds of articles that are very useful to know. I’m thoroughly enjoying your blog. And Good comments create great relations. You’re doing an excellent job. Keep it up.

    Magento Development Training Course in Chennai Zuan Education

    Selenium Training Course in Chennai Zuan Education

    ReplyDelete
  33. Write a C program to print all prime number between 1 to 300 using for loop.

    Code of given problem:

    int main()
    {
    int a,b;
    printf("List of prime numbers between 1 to 300:\n");
    printf("%d\t",a=2);
    for(a=1;a<=300;a++)
    {
    for(b=2;b<=a-1;b++)
    if(a%b==0)
    break;
    else if(b==a-1)
    {
    printf("%d\t",a);
    }
    }
    return 0;
    }

    Very informative blog!
    Please take some time to visit my blog @
    Top 10 programming examples in C

    Thanks!

    ReplyDelete

  34. Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear.i also want to inform you the learn salesforce development . thankyou . keep sharing..

    ReplyDelete
  35. Nice article. your algo for solving problem is very good . visit more good problem collection Top coding programs

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    angular js online training
    best angular js online training
    top angular js online training

    ReplyDelete
  38. Well Done ! the blog is great and Interactive it is about Python Search Notes it is useful for students and Python Developers for more updates on python follow the link

    python Training in chennai

    python Course in chennai

    ReplyDelete
  39. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    angular js online training
    best angular js online training
    top angular js online training

    ReplyDelete
  40. Really nice blog, very infromative. You can refer more topics related to C language like C pointers and C Programs from here for future articles

    ReplyDelete
  41. Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
    angular js online training
    best angular js online training
    top angular js online training

    ReplyDelete
  42. This comment has been removed by the author.

    ReplyDelete
  43. +96893560417 Muscat escort I'm Roshni! I have a thin and surprising body, regular boobs which you can have loads of fun with me. Escort Muscat Polite and we'll dressed, conversant in English. A refined and tasteful young lady who will make your dreams materialize Oman Escort +96893560417
    Escort in Oman
    Muscat escort
    Escort Muscat
    Escort in Muscat

    ReplyDelete
  44. I appreciate you getting this to me so quickly so I have time to review it.
    on demand app solutions

    ReplyDelete
  45. Anyone having a keen interest in artificial intelligence which require analytical knowledge and want to contribute to these fields, MBA in Artificial Intelligence is definitely for you.

    ReplyDelete
  46. Thank you for giving such an informative information; it would be beneficial to both old and new students for improved preparation. I appreciate your efforts in making such a valuable resource available to everyone. C Programming Notes For BCA Students

    ReplyDelete