473,386 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Logic(Array) in C#(V1.1)


Hi,

What is the logic to compare Values.

First array={5,5,6,7};
Second array={5,3,3,2};

Explanation:
1.First array first element is greater than the second array first
element, No need to check remaining cases.
2.First Array First Element is same as second array First element then
we need to check first array second element to second array second
element.
3.If First Array second element is greater than the second array second
element no need to check remaining cases...

Remainig cases also same as the above...

Please do the help.

Thanks in Advance.

regards

*** Sent via Developersdex http://www.developersdex.com ***
Mar 28 '06 #1
1 2307

"Kondapanaidu" <kondapanaidu> wrote in message
news:uT**************@TK2MSFTNGP12.phx.gbl...

Hi,

What is the logic to compare Values.

First array={5,5,6,7};
Second array={5,3,3,2};

Explanation:
1.First array first element is greater than the second array first
element, No need to check remaining cases.
2.First Array First Element is same as second array First element then
we need to check first array second element to second array second
element.
3.If First Array second element is greater than the second array second
element no need to check remaining cases...

Remainig cases also same as the above...

Please do the help.

Thanks in Advance.

regards

Are the contents of the array elements always going to be integer? If so
convert them to a number with the same number of digits and then compare. So
in your example {5,5,6,7} = 5567 and {5,3,3,2} = 5332 and the check is (5567 5332), etc. Should simplify it.
If the elements are not always integer then you'll have to check the
elements using a loop unless c# has a built in function to do this that I'm
not aware of.


*** Sent via Developersdex http://www.developersdex.com ***

Mar 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
by: VK | last post by:
And this script supposes to work everywhere. It allows to get the name of any function from within the function itself. <html> <head> <title>Function name</title> <meta...
7
by: Ron | last post by:
Hello, I have 4 classes that use 4 DTS packages on 4 different tables. So I have Dim cls1 As New clsDTS1, cls2 As New clsDTS2 Dim cls3 As New clsDTS3, cls4 As New clsDTS4 Each class has a...
104
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from...
10
by: wenmang | last post by:
hi, I have following: struct array1 { int id; char *name; }; struct array2 {
6
by: Jeff Gardner | last post by:
Greetings: I am attempting to get conditional output based on POSTed form data. If the posted value is either the key or value of an array, $x=key and $q=foo. elseif it is neither key nor...
272
by: Peter Olcott | last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a I think that the operator() member function does not work correctly, does anyone else know how to make a template for making two...
7
by: ashjas | last post by:
Hello, I have run this logic on turboc++ 3.0 and it is working fine on it but its not running on msvs2008 c++. i am not able to assign the value like this *temp=*main,where main and temp are char...
0
by: Marc 'BlackJack' Rintsch | last post by:
On Fri, 23 May 2008 07:14:08 -0400, inhahe wrote: The logic part has the rules how you may move the pieces. The GUI shouldn't have to know how a knight, bishop, or queen can move or what...
33
by: Adam Chapman | last post by:
Hi, Im trying to migrate from programming in Matlab over to C. Im trying to make a simple function to multiply one matrix by the other. I've realised that C can't determine the size of a 2d...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.