how to find the largest of given numbers in an array

Answers were Sorted based on User's Feedback



how to find the largest of given numbers in an array..

Answer / 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

how to find the largest of given numbers in an array..

Answer / 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

More OOPS Interview Questions

What are the benefits of polymorphism?

0 Answers  


How to hide the base class functionality in Inheritance?

0 Answers   Viscus Infotech,


Which is better struts or spring?

0 Answers  


how to swap to variables without using thrid variable in java?

5 Answers  


What is advantage of inheritance?

0 Answers  






What is constructor overloading in oop?

0 Answers  


c++ is a pure object oriented programming or not?

5 Answers   Wipro,


wht is ditch

0 Answers  


Finding of the 4 larger (bigger) numbers from the list like{1245,4587,2145,1163,29987,65783.....}

1 Answers   Wipro,


Which method cannot be overridden?

0 Answers  


What is persistence in oop?

0 Answers  


What is a function in oop?

0 Answers  


Categories