#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int max;
int num;
for (int counter = 0; counter<15; counter++)
{
cout <<"Enter a number: ";
cin >> max;
cout << "Enter another number: ";
cin >> num;
if (num > max)
num = max;
cout << "The largest number is " <<max;
}
return 0;
}
60 is one of 5 numbers that has 12 arrays.
Even numbers
no
we can call the number that cannot be arranged into 2- row arrays multiple arrays.
Even numbers.
They are simply rectangular arrays of numbers.
0,2,4,6,8,10,12,14,16,18,20
Program below?!
Odd numbers.
abdulrahman
arrays programms in visual basic
Without Using Arrays Program: #include<stdio.h> main() { int n,m,i,max; printf("How many numbers(n) you going to enter:"); scanf("%d",&n); printf("Enter the numbers:"); scanf("%d",&m); max=m; for(i=2;i<=n;i++) { scanf("%d",&m); if(m>max) max=m; } printf("The Largest Number is %d",max); } Output: How many numbers(n) you going to enter:5 Enter the numbers: 25 410 362 5 56 The Largest Number is 410 With Using Arrays Program: #include<stdio.h> #include<conio.h> void main() { int max_num(int a[],int n); int max,i,n; int a[50]; clrscr(); printf("Enter n number:"); scanf("%d",&n); printf("Enter the numbers:"); for(i=0;i<n;i++) scanf("%d",&a[i]); max=max_num(a,n); printf("The largest number is %d",max); getch(); } int max_num(int a[],int n) { int i,m=0; for(i=0;i<n;i++) { if(a[i]>m) m=a[i]; } return m; } output: Enter n number:10 Enter the numbers: 123 456 789 963 852 147 5 56 600 753 The largest number is 963