-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
39 lines (29 loc) · 807 Bytes
/
main.cpp
File metadata and controls
39 lines (29 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <iostream>
using namespace std;
int main() {
// Predefined student details
string name = "Dio";
string surname = "Alex";
string student_id = "123456";
// 3x3 C-style array of marks
int marks[3][3] = {
{86, 90, 78},
{88, 76, 92},
{81, 89, 84}
};
int number_of_rows = 3;
int number_of_columns = 3;
// Print student details
cout << "Name: " << name << endl;
cout << "Surname: " << surname << endl;
cout << "Student ID: " << student_id << endl;
cout << "\nMarks:" << endl;
// Print array contents
for (int col = 0; col < number_of_columns; col++) {
for (int row = 0; row < number_of_rows; row++) {
cout << marks[row][col] << " ";
}
cout << endl;
}
return 0;
}