EXPLAINATION: what if i have 3 set of values
e.g
1,2,3,4,5
7,8,9,4,5
9,6,3,2,1
i want to use 3 variables a,b,c one for each set of values
QUESTION: now my question is that how do i change the values continously in a b and c so that each value from one set gets compared with the others in every possible way?????
how do i write this programme in c++????
5 7201
Read about how to use arrays.
- main()
-
{
-
int arr1[]={your first set};
-
int arr[2}={ your second set}
-
int i,j;
-
for(i=j=0;i<first array size,j<second array size; i++,j++)
-
{
-
if(arr[i]==arr[j])
-
{
-
printf("equal");
-
}
-
else
-
{
-
printf("unequal");
-
}
-
getch()
-
}
main()
{
int arr1[]={your first set};
int arr[2}={ your second set}
int i,j;
for(i=j=0;i<first array size,j<second array size; i++,j++)
{
if(arr[i]==arr[j])
{
printf("equal");
}
else
{
printf("unequal");
}
getch()
}
Congratulations, you have just been nominated for the CCOTD contest (*) stay tuned.
kind regards,
Jos
(*) Crappiest Code Of The Day
You will probably need nested for loops to do this.
Congratulations, you have just been nominated for the CCOTD contest (*)
Here is my entry: - #include "iostream.h"
-
main() {
-
for (i = 1, i < 100, i = i + 1){;
-
cout >> Hello world};
-
cin.get;
Sorry, shahzeb. Please read this bit of the posting guidelines.
QUESTION: now my question is that how do i change the values continously in a b and c so that each value from one set gets compared with the others in every possible way?????
how do i write this programme in c++????
What do you mean "each value from one set gets compared with the others in every possible way"? Each such comparison could have a different value ... do you envisage some way of amalgamating all of these comparisons into a single results? Are you just looking for a framework for performing these comparisons that you'll insert more code into later?
Oh yeah; almost forgot my entry for CCOTD. I can't compete with these, so in the "so bad its good" category I refer you to International Obfuscated C Contest The Underhanded C Contest Duff's Device
Don't try any of these at home.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Andy Fish |
last post by:
Hi,
I just found this template in someone else's xslt (it's Microsoft's
"word2html" stylesheet to convert WordProcessingML to HTML)
<xsl:template match="WX:sect">
<xsl:variable...
|
by: NickName |
last post by:
I have the following situation. One set of data has 274 rows (set2)
and anther has 264 (set1). Both data sets are similar in structure as
well as values for both of them were extracts from the...
|
by: Odd-R. |
last post by:
I have to lists, A and B, that may, or may not be equal. If they are not
identical, I want the output to be three new lists, X,Y and Z where X has
all the elements that are in A, but not in B, and...
|
by: Manny Chohan |
last post by:
Hi, i have two datetime values in format 11/22/04 9:00 AM and 11/22/04 9:30
AM. How can i compare dates .net c# or if there is any other way such as
Javascript.
Thanks
Manny
|
by: Dennis |
last post by:
I have a public variable in a class of type color declared as follows:
public mycolor as color = color.Empty
I want to check to see if the user has specified a color like;
if mycolor =...
|
by: John Salerno |
last post by:
I'd like to compare the values in two different sets to test if any of
the positions in either set share the same value (e.g., if the third
element of each set is an 'a', then the test fails).
I...
|
by: Yash |
last post by:
Hi,
We are in the process of tuning the performance of our stored procs in
SQL 2000 and are looking for a tool that would help us in comparing
the result sets of an old SP and a modified SP. The...
|
by: jenkinsloveschicken |
last post by:
Is it possible to compare a single value to many in a single statement? Here is what I am attempting to do:
1. Users lands on page and via a cookie check function they are identified.
2. A query...
|
by: DomiNeug |
last post by:
Hello,
Since a while i have to find a way of comparing "Sets" (multiple int Values) and so to find equal sets. There simply 3 tables
ValueList with: ID int
ValueListHasValue: ID int, ValueListID...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |