Is it true I do like below, if I want to all data array? and the ouput is 2. How to know which array that computer take? -
#include <iostream>
-
#include <conio.h>
-
#include <cstdlib>
-
#include <math.h>
-
#include <stdio.h>
-
#include <time.h>
-
using namespace std;
-
-
int i, j;
-
int x[6];
-
int A[6], B[6], C[6], D[6], E[6], F[6];
-
// The members of the array int minimum = numbers[0] ;
-
int minimum;
-
int main(void)
-
{
-
{
-
for(i=1;i<7;i++)
-
-
{
-
for(i=1;i<7;i++)
-
{
-
x[i]=i;
-
A[i]=(2+pow(x[i],2));
-
B[i]=(1+pow(x[i],3));
-
C[i]=(2+pow(x[i],2)-1);
-
D[i]=(3*pow(x[i],3));
-
E[i]=(1+pow(x[i],2));
-
F[i]=(3+pow(x[i],2));
-
}
-
{
-
printf("\n");
-
-
for(i=1;i<7; i++)
-
-
{
-
printf("[%d][%d] A[%d]=%d\n", i,1, i, A[i]);
-
}
-
printf("\n");
-
for(i=1;i<7; i++)
-
-
{
-
printf("[%d][%d] B[%d]=%d\n", i,2, i, B[i]);
-
-
}
-
printf("\n");
-
for(i=1;i<7; i++)
-
-
{
-
printf("[%d][%d] C[%d]=%d\n", i,3, i, C[i]);
-
-
}
-
printf("\n");
-
for(i=1;i<7; i++)
-
-
{
-
printf("[%d][%d] D[%d]=%d\n", i,4, i, D[i]);
-
-
}
-
printf("\n");
-
for(i=1;i<7; i++)
-
-
{
-
printf("[%d][%d] E[%d]=%d\n", i,5, i, E[i]);
-
}
-
printf("\n");
-
for(i=1;i<7; i++)
-
-
{
-
printf("[%d][%d] F[%d]=%d\n", i,6, i, F[i]);
-
}
-
}
-
}
-
}
-
printf("\n");
-
-
printf ("A\tB\tC\tD\tE\tF");
-
printf ("\n_\t_\t_\t_\t_\t_\t");
-
-
for(i=1;i<7;i++)
-
{
-
cout<<endl;
-
-
printf("%d\t", A[i]);
-
printf("%d\t", B[i]);
-
printf("%d\t", C[i]);
-
printf("%d\t", D[i]);
-
printf("%d\t", E[i]);
-
printf("%d\t", F[i]);
-
}
-
-
-
// Compare the members
-
minimum = A[i], B[i],C[i], D[i], E[i], F[i]; for (int i = 1; i < 7; ++i)
-
{
-
if (A[i], B[i],C[i], D[i], E[i],F[i] < minimum)
-
minimum = A[i], B[i],C[i], D[i], E[i],F[i]; }
-
-
printf("\n");
-
// Announce the result
-
cout << "The lowest member value of the array is "<< minimum << "." << endl;
-
-
return 0;
-
}
1 1350 sicarie 4,677
Recognized Expert Moderator Specialist
keith katthy-
You have been banned for non-observance of the Posting Guidelines. This ban will expire in 7 days, however, any further violations of the Posting Guidelines will result in an immediate and permanent ban from this site.
sicarie
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: lawrence |
last post by:
I had some code that worked fine for several weeks, and then yesterday
it stopped working. I'm not sure what I did. Nor can I make out why it
isn't working. I'm running a query that should return 3 items from the
database. I then get a count of the return, which correctly tells me
that I've got 3 items. I then go into a for loop which I expect to
loop 3 times and print out the 3 items. Here is where things get
strange: it loops 3 times and...
|
by: jerrygarciuh |
last post by:
Hello,
In this sample script I create an array of objects. Print out their data
with print_r().Update their data with a sub called v_set(). Print out data
showing the chnages using print_r(). I push the altered objects into a new
array and print them out again, still see the updated data. Then I iterate
over the original array again with print_r and the objects lose the updates
and have their original data.
Can anyone explain what I...
|
by: Michael Kirchner |
last post by:
Hi everybody
The output of my multiple dimension array is quite confusing.
Im declaring an array, store some values in it and then I save the array
in a session variable. On an other page I store the data of the
session in a new multiple dimension array.
All data are saved correctly in the array of the 1st page. But in the
new array of the 2nd page there is only one entry. Does anybody knows
|
by: Scott J. McCaughrin |
last post by:
The following program compiles fine but elicits this message from the
linker: "undefined reference to VarArray::funct" and thus fails.
It seems to behave as if the static data-member: VarArray::funct were
an extern, but it is declared in the same file (q.v.). What is the
remedy for this?
=================
|
by: Kutty Banerjee |
last post by:
hi ,
i ve
int (*Data);
int A={1,2,3,4};
Data=&A;
//Question here, how d i dynamically allocate space for Data using calloc?
printf("%d\n",*Data) ; //gives 1
//But printf("%d\n",*Data) produces weird value.
| |
by: Bart Goeman |
last post by:
Hi,
I have a question about how to put redundant information in data
structures, initialized at compile time. This is often necessary
for performance reasons and can't be done at run time (data
structures are read only)
Ideally one should be able to put the redundant
information there automatically so no mistakes are possible, but in a lot
of case I see no way how to do it.
|
by: becca0619 |
last post by:
Hey, Ive been looking around to find out how to read data into a 2D array and I cant find a solution that will fit my assignment. Im not sure that I should even use an array actually...
ok so there is a text file set up like this
21909 87 98 95 96 79
21910 74 75 84 86 57
21911 84 85 82 80 79
etc... There is no defined number of items in the file. (my professor wants to be able to read in any number of "rows" but there will always be 6...
|
by: brainflakes.org |
last post by:
Hi guys,
I need to manipulate binary data (8 bit) stored in a 2 dimensional
array.
I've tried various methods (arrays, using a string filled with chr(0),
using gd lib) and so far the fastest way I've found is to actually
create an 8-bit image in GD and use imagecolorat and imagesetpixel to
read and write the data.
|
by: KevinADC |
last post by:
Introduction
This discussion of the sort function is targeted at beginners to perl coding. More experienced perl coders will find nothing new or useful. Sorting lists or arrays is a very common requirement of programs. If you don't know the difference between a list and array don't worry about it. A list is just an array without a name. They both can hold the same type of data: scalars or strings. I will use the terms "list" and "array" to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |