how to find the largest of given numbers in an array

Answer Posted / anmol.s.fattepur

void ANMOL()
{
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 ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is polymorphism in oops?

556


What is class in oop with example?

616


What is new keyword in oops?

589


What is the difference between procedural programming and oops?

550


Write a program to sort the number with different sorts in one program ??

1914






What is the difference between inheritance and polymorphism?

586


What is overloading in oop?

572


Prepare me a program for the animation of train

1994


What is the difference between a constructor and a destructor?

611


What is encapsulation with real life example?

568


What is polymorphism explain?

685


How does polymorphism work?

635


What is the point of oop?

650


when to use 'mutable' keyword and when to use 'const cast' in c++

1642


I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...

1622