Saturday, 14 February 2015

FIND INDEX OF LARGEST NUMBER IN ARRAY in c++

Structure of the Problem Requirements  

The Program find the biggest index number of an array in C++ Program. The user will enter five numbers in array and then find the biggest number in them .

Source Code 

#include<iostream>
using namespace std;
int main ()
{
int num[5];
int a;
int index;
for ( int i =0; i<5;i++ )
{
cout<<" Enter Your Number : ";
cin>>num[i];
}
for (int i =0; i <5;i++)
{
if (num[i]>a)
{
a = num [i];
index = i;
}
}
cout<<" The Index of Biggest Number is : "<<index;
}

Output of the Program

FIND INDEX OF LARGEST NUMBER IN ARRAY in c++


Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

0 comments:

Post a Comment