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

what is page hit in operating system?

5 Answers   TCS,


Difference between HTML and DHTML?

0 Answers  


3. . Explain the Cache memory? What is the advantage of a processor having more cache memory?

1 Answers  


Full from of MP3?

2 Answers  


What is the difference b/w Object base and object oriented programming?

1 Answers  


Binary tree?

1 Answers   Mascot,


hi all, i need ur help in preparing a sql which performs scd2, i mean i have a scd2 mapping i need a sql which can give me same result as scd2 mapping, SRC table: cust_no, loc 01 abc 02 xyz TGT table: pm_ky cust_no loc current_flag 1 01 abc Y 2 02 xyz Y cust 1 has changed his loc to xyz then it loads into TGT table as below, pm_ky cust_no loc current_flag 1 01 abc N 2 02 xyz Y 3 01 xyz Y i need sql to get the above result, hope got me question, Any suggestion will be appreciate.. thanks, Vinod

0 Answers  


what is the main usage of an abstract keyword?please follow the program class A { void display() { System.out.println("hai"); } void print() { } } class B extends A { void print() { System.out.println("Hello"); } } In this program i was gives the implementation of print() according to my requirements in subclass.And there is no definition in superclass then why we can use abstract keyword before a method that i want to gives definition in other classes,is any mistakes in the above usage of method?

0 Answers  


can we convert .class file to dll file

1 Answers  


1. Write a program to create a sentence at runtime and count number of vowels in it ? 2. Write a program to get a string and to convert the 1st letter of it to uppercase ?

0 Answers   HTC,


what is delegate and delegation model give the real live example on delegate model

0 Answers   TCS,


Describe the following: (i) DNS (ii) Name Resolution (iii) Subnet Masking (iv) Urgent Pointer

1 Answers  


Categories