write a program on c(or)c++(or)java language i.e if i have 5
numbers like (10,24,3,9,15) i want to display highest number
from these numbers

Answers were Sorted based on User's Feedback



write a program on c(or)c++(or)java language i.e if i have 5 numbers like (10,24,3,9,15) i want to ..

Answer / bhavesh gharat

#includ <conio.h>
#include <stdio.h>

void main()
{
int a[]={10,24,3,9,15};

int temp=a[0];

for(int i=1;i<a.length;i++)
{
if(temp<a[i])
{
temp=a[i];
}
}
printf(" higest no="+temp);
}

Is This Answer Correct ?    4 Yes 1 No

write a program on c(or)c++(or)java language i.e if i have 5 numbers like (10,24,3,9,15) i want to ..

Answer / ashwek

/// Using C++

#include<iostream.h>
#include<conio.h>

int main(){
int arr[]={10,24,3,9,15};
int Max=arr[0];

for(int i=1; i<5; i++)
if(Max < arr[i]){
Max = arr[i];

cout<<"Higest number is = " <<Max;
return 0;
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Programming Languages AllOther Interview Questions

2. What do you mean by DHCP?

1 Answers  


Hi I am Rathnam, How To Remove the duplicates with out using remove duplicate stage in the datastage

0 Answers   TCS,


5.Call by value and Call by reference with program?

0 Answers  


You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)

0 Answers   Amazon,


what is microprocessor?

1 Answers   HCL,






hi friends please tel me how to handle the recovery manager(All i.e PopUp ,Application Crach ,Object state,etc) in QTP

1 Answers   IBM,


Hi guyes, I have cleared 2 technical rounds with cts for liferay and java techonologies, i have client round next week, please tell me how to prepare for this what questions i should be ready to face?

0 Answers  


hi friends i am ravi here , i have one problem at starting at the interview that is i have my 3+ it(java) years experiance profile so if i attend the interview interviewer ased me tel me about your profile so i not able to explain because i dont knw where to start and where to end and i dont know what i should tel and what i shouldnot tel .....so can any body please clear m doubts clearly.............please help me friends,i am awaiting for friends reply please.............

2 Answers   TCS,


An image map is a collection of

1 Answers   Velocis,


what is class module in vb6? what it's use? with example..

0 Answers  


1.Mutating table

0 Answers  


what is the difference between primary key and unique key?

2 Answers   KTree, TCS,


Categories