how to get the minimum values from the number that I have generate? - #include <iostream>
-
#include <conio.h>
-
#include <cstdlib>
-
#include <math.h>
-
#include <stdio.h>
-
#include <time.h>
-
using namespace std;
-
-
int i, j;
-
int x[10];
-
int A[10], B[10], C[10], D[10], E[10], F[10];
-
-
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]);
-
}
-
_getch();
-
}
6 1544
how to get the minimmum valuesfrom the number that I have generate?
#include <iostream>
#include <conio.h>
#include <cstdlib>
#include <math.h>
#include <stdio.h>
#include <time.h>
using namespace std;
int i, j;
int x[10];
int A[10], B[10], C[10], D[10], E[10], F[10];
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]);
}
_getch();
}
You want to find the minimum from all the arrays you are using in your code??
yes. like that. - #include <iostream>
-
#include "ayam.cpp"
-
using namespace std;
-
-
int Min(const int *Numbers, const int Count)
-
{
-
int Minimum = Numbers[0];
-
-
for(int i = 0; i < Count; i++)
-
if( Minimum > Numbers[i] )
-
Minimum = Numbers[i];
-
-
return Minimum;
-
}
-
-
double Min(const double *Numbers, const int Count)
-
{
-
double Minimum = Numbers[0];
-
-
for(int i = 0; i < Count; i++)
-
if( Minimum > Numbers[i] )
-
Minimum = Numbers[i];
-
-
return Minimum;
-
}
-
-
int main()
-
{
-
int Nbrs[] = { A[i] };
-
int Total = sizeof(Nbrs) / sizeof(int);
-
-
int Minimum = Min(Nbrs, Total);
-
cout << "Minimum: " << Minimum << endl;
-
-
return 0;
-
}
Ganon11 3,652
Recognized Expert Specialist
Are you using C or C++? I see a lot of printf statements in there, which suggests C to me, but you are also including "ayam.cpp" which says C++ to me. Go with one or the other - it's not always a great idea to mix the two, as C can get messy.
#include "ayam.cpp"
You do not include source files.
If you have three source files in your program and two of them include the third, then everything inthe included source file is duplicated and that will cause redefinition errors in the link step.
You add the source files to your project and you use function prototypes to call the functions not in the current file.
i use c++, but i dont how to use cout, so I use , printf. My question, is how to call the data A[i]?
sicarie 4,677
Recognized Expert Moderator Specialist
i use c++, but i dont how to use cout, so I use , printf. My question, is how to call the data A[i]?
Just like that.
Keith Katthy - this is an official warning. Keep all questions based on the same code in a single thread. The rules to this site are defined clearly in the Posting Guidelines, and you are now responsible for knowing and following all of them. Failure to do so will result in action taken against your account.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Lobang Trader |
last post by:
Hi all,
I am trying to create a username and a password class.
I would like to know what are the RECOMMENDED minimum and maximum length
for both fields?
These fields will be something like...
|
by: Mitch Olson |
last post by:
Hi
our company is just about to embark on developing a PIM-type application and
would like to use .NET (VB6 is our distant option 2).
The question we are currently investigating is whether the...
|
by: Harry_Crow |
last post by:
I want to restrict the minimum size of the form. I find that there are
properties MaximumSize and MinimumSize. This will help you control the
maximum and minimum size the form, when the form is...
|
by: Hennie de Nooijer |
last post by:
I have a problem (who not?) with a function which i'm using in a view.
This function is a function which calculates a integer value of a
date. For example: '12/31/2004 00:00:00" becomes 20041231....
|
by: Hennie de Nooijer |
last post by:
Because of an error in google or underlying site i can reply on my own
issue. Therefore i copied the former entered message in this message....
| |
by: Vikrant |
last post by:
On my DB2/UDB system, some tablespace 'Minimum recovery time' is
2000-11-19 or some '1999-10-04' or different, for some tablespace
theres is no 'Minimum recovery time' , what does it tell me?
...
|
by: David Sworder |
last post by:
Hi,
I'm writing an application in which a client (C#/WinForms) and server
(C#/service) interact with one another. The client establishes a "session"
with the server but for scalability reasons...
|
by: JJLaRocque |
last post by:
Hi all,
Is there a simple python function to return the list index of the
minimum entry in a list of lists?
ie, for , , ] to return 2,4.
Or, same question but just for a list of numbers, not a...
|
by: manxie |
last post by:
Dear All Readers,
I'm supposed to create a program with a switch and using voids to execute number of codes, that includes finding sum, average, maximum, and minimum, please read my code:...
|
by: Ioannis Vranos |
last post by:
Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char types?
Or only about the minimum value ranges of them?
|
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,...
| |
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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...
|
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,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
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...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |