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 is oop in simple words?

1 Answers  


What is a friend function & its advantage?

2 Answers   TCS,


Why do we use oops?

1 Answers  


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1 Answers  


Which language is not a true object oriented programming language?

1 Answers  


WHEN A COPY CONSTER IS CALL ?

4 Answers  


What is an object?

14 Answers   HCL,


3. Differentiate verification and validation.

1 Answers  


Conversion from a basic type to a class type may be achieved using______________

5 Answers   HCL,


can inline function declare in private part of class?

2 Answers  


what is the difference b/w abstract and interface?

2 Answers   Merrill Lynch, Schneider, Scio Healthcare,


Does c++ support multilevel and multiple inheritance?

9 Answers   IBS, Wipro,


Categories