Sec A Lab Quiz 3
Sec A Lab Quiz 3
Note: After Completing quiz, you should submit this MS word file on GCR
Q1. Using array of pointers, write C++ code to find stats of array according to the given output.
CODE:
#include <iostream>
using namespace std;
struct input {
int arr[10];
};
cout << "Maximum Value: " << max <<"at the index "<< m_max<< endl;
cout << "Minimum Value: " << min <<"at the index "<<m_min<< endl;
cout << "Sum of Array: " << sum << endl;
cout << "Average of Array: " << avg << endl;
}
int main() {
int i = 0;
input* entry = new input; // object created for struct input
cout << "Enter array elements: " << endl;
for (i = 0; i < 10; i++) {
cout << "Enter element " << i << ": ";
cin >> entry->arr[i];
}
Page 2 of 3
CL-1002 Programming Fundamentals - Lab (CE) / SEC A / Spring’25 / -Quiz 03 / LLO-03
28/04/2025 Marks: 10/ Time: 20 min
Name: ____Muhammad Ashnab Safdar________ Roll No: _I24-6500__ Section: _CE-A___
Page 3 of 3