saving . . . saved comparsion of an array elements has been deleted. comparsion of an array elements has been hidden .
comparsion of an array elements
Title
Question
How to compare an array elements with each others.
Ex. If i want to count the same data types in an array.
I just want to know which type of loop is suitable for this and
how to initialize the loop.
Please help.

Advance-C General None min None sec 03-04-20, 5:23 p.m. Jadoo

Answers:

FOR COMPARING ARRAY ELEMENT YOU CAN USE 'for ();' THAT IS BEST 
AND HOW TO COMPARE ARRAY ELEMENT THAT YOU CAN TAKE AS BELOW EXAMPLE
int min ,i ;
int arr={6,4,2,123,-6,0);
min = arr[0];
for ( i=1 ;i < 6 ; i++)
{
if arr[i]<=min;
min = arr[i];
}

BY ABOVE CODE YOU CAN FIND THE SMALLEST VALUE FROM GIVEN ARRAY ELEMENT AND BY THIS EXAMPLE ONLY YOU COMPARE EACH ELEMENT OF AN ARRYA

I THINK YOU SATISFY WITH MY BOTH ANSWER KINDLY REPLY OR COMMENT ASAP

THANK YOU SPOKEN TUTORIAL FORUMS AND THANK YOU LEARNER
19-04-20, 4:22 p.m. abhijeet jadeja


Log-in to answer to this question.