how to find the largest of given numbers in an array

Answer Posted / jvhariharan

void main()
{
int a[10],i,max,m;
pf("enter the range of array");
sf("%d",&m);
pf("enter the values:");
for(i=0;i<m;i++)
{sf("%d",&a[i]);
}
max=a[0];
for(i=1;i<m;i++)
{if(a[i]>max)
{max=a[i];
}}
pf("the max no:%d",max);
}

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between oop and pop?

611


How to improve object oriented design skills?

569


What are the 3 pillars of oop?

611


Whats is abstraction in oops?

589


c++ program to swap the objects of two different classes

1761






What is the oops and benefits of oops programming?

549


What is advantage of inheritance?

687


What is purpose of inheritance?

643


Why interface is used?

549


Which language is pure oop?

545


What is overriding in oops?

600


What is encapsulation in ict?

605


What are the three parts of a simple empty class?

1456


write a program to find 2 power of a 5digit number with out using big int and exponent ?

1893


What is the real time example of inheritance?

637