Assigment-folder(To find the biggest number in a 1D array in C,) | Code2night.com
Code2night
  • Home
  • Blogs
  • Guest Posts
  • Tutorial
  • Post Blog
  • Register
  • Login
  1. Home
  2. Blogpost

Assigment-folder(To find the biggest number in a 1D array in C,)

Date- Dec 09,2023

1522

To find the biggest number in a 1D array in C, you can iterate through the array and keep track of the maximum value encountered.






#include<stdio.h>
#include<conio.h>
void main()
{
     int a[4],big,i;
     clrscr();
     printf("enter the value");
     for(i=0;i<=4;i++)
     {
     scanf("%d",&a[i]);
     }
     big=a[0];
     for(i=1;i<=4;i++)
     {
     if(a[i]>big)
     big=a[i];
     }
     printf("Biggest value is %d",big);
     getch();
}

In this example, we start by initializing the big variable to the first element of the array. Then, we loop through the array, comparing each element to the current maximum (big). If we find an element greater than big, we update big to that element. Finally, after the loop, big will contain the largest number in the array.

Make sure to replace the a[i] array with your own array if you want to find the largest number in a different set of numbers.

Comments

Tags

LinkedinLogin
LinkedinProfile
GetLinkedinProfile
C#
Aspnet
MVC
Linkedin
ITextSharp
Export to Pdf
AspNet Core
AspNet
View to Pdf in Aspnet
Model Validation In ASPNET Core MVC 60
Model Validation
Model Validation In ASPNET Core MVC
Model Validation In ASPNET
Image Compression in AspNet
Compress Image in c#
AspNet MVC
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1190
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook

Welcome To Code2night, A common place for sharing your programming knowledge,Blogs and Videos

  • Panipat
  • info@Code2night.com

Links

  • Home
  • Blogs
  • Tutorial
  • Post Blog

Popular Tags

Copyright © 2025 by Code2night. All Rights Reserved

  • Home
  • Blog
  • Login
  • SignUp
  • Contact
  • Terms & Conditions
  • Refund Policy
  • About Us
  • Privacy Policy
  • Json Beautifier
  • Guest Posts