//Ahmad Furqan Attari
//p7.4
#include <iostream>
#include <conio.h>
using namespace std;
const int SIZE = 10;
int maxint(int (&num)[SIZE],int max)
{
int large=num[0],index=0;
for (int i = 1; i < max; i++)
{
if (num[i]>large)
{
large = num[i];
index = i;
}
}
return index;
}
void main(void)
{
int num[SIZE];
char ch;
int i = 0;
do
{
cout << "Enter a number: ";
cin >> num[i];
i++;
cout << "Enter again?(y/n): ";
ch = _getche();
cout << endl;
} while (ch == 'y' && i < SIZE);
cout << "Greatest number entered: " << num[maxint(num,i)];
_getch();
}
Sunday, 30 November 2014
Chapter 7,Problem 4:Object Oriented Programming by Robert Lafore in C++ Solution Manual
Subscribe to:
Post Comments (Atom)
plz i need a solution of chap 6 prblm 4 by robert lofer
ReplyDeletehttps://github.com/phoenixx1/Robert-Lafore
ReplyDeletetysm bruh
DeletePlz j needd a solution of ch 7 problems by robert lofer
ReplyDelete