Write a function that takes an integer array as an input and find the largest number in the array. You cannot sort array or use any API or searching needs ?
#include<iostream>
using namespace std;
int main()
{
int name[5],big,i;
for(i=0; i<=4; i++) {
cout << "Enter a value" << i << ":";
cin >> name[i];
}
cout << "name contains:";
for(i=0; i<=4; i++) {
cout << name[i]<< "\n";
}
big = name[0];
for(i = 0; i <= 4; i++) {
if(name[i] > big)
big = name[i];
}
cout << "The Bigest Number::" << big << endl;
return 0;
}
Categorized in:
Tagged in:
2d array c++, Accenture interview questions and answers, algorithm to find largest number in an array, Applied Materials interview questions and answers, array find, array in c, array in c programming, array programs in java, Atos interview questions and answers, BMC Software interview questions and answers, Bosch India Software interview questions and answers, c interview questions, c program to find largest number in an array, c program to find largest number in an array using function, c program to find largest of n numbers, c++ array class, c++ array functions, c++ program to find largest and second largest number in an array, c++ program to find largest and smallest number in an array, c++ program to find largest of n numbersdynamic array c++, CASTING NETWORKS INDIA PVT LIMITED interview questions and answers, Chetu interview questions and answers, Ciena Corporation interview questions and answers, cpp interview questions, cpp interview questions and answers, Dell International Services India Pvt Ltd interview questions and answers, eInfochips interview questions and answers, Electronics Arts Inc interview questions and answers, find largest number in an array, find largest number in array, find largest number in array c++, find largest number in array in java, find largest number in array java, find largest number in array javascript, find largest number in java, find second largest number in array in java, find smallest number in array c++, Flipkart interview questions and answers, Harman International interview questions and answers, Indecomm Global Services interview questions and answers, java find largest number in list, largest number formed from an array in clength of array c++, Larsen & Toubro interview questions and answers, Mathworks India Private Limited interview questions and answers, Mavenir interview questions and answers, Mphasis interview questions and answers, NetApp interview questions and answers, Oracle Corporation interview questions and answers, PeopleStrong interview questions and answers, Philips Software Centre Pvt Ltd interview questions and answers, program to find largest number in an array, return array c++string array c++, SRM Technologies interview questions and answers, Symphony Teleca interview questions and answers, Tech Mahindra interview questions and answers, Tecnotree interview questions and answers, two dimensional array in c++ example, Wipro Infotech interview questions and answers, Wipro interview questions and answers, Yash Technologies interview questions and answers, zycus infotech interview questions and answers