#include <iostream>
using namespace std;
int main() {
int n; cin >> n;
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int temp = arr[n-1];
for (int i = n-1; i > 0; i--) {
arr[i] = arr[i-1];
}
arr[0] = temp;
for (int i = 0; i < n; i++) {
cout << arr[i] << " ";
}
return 0;
}
using namespace std;
int main() {
int n; cin >> n;
int arr[n];
for (int i = 0; i < n; i++) {
cin >> arr[i];
}
int temp = arr[n-1];
for (int i = n-1; i > 0; i--) {
arr[i] = arr[i-1];
}
arr[0] = temp;
for (int i = 0; i < n; i++) {
cout << arr[i] << " ";
}
return 0;
}
❤5
🎓 Students!
I hope today's exam goes smoothly and you feel confident about every question. Wishing you clear mind🧠, confidence 🙂↔️ and great results✅.
I hope today's exam goes smoothly and you feel confident about every question. Wishing you clear mind🧠, confidence 🙂↔️ and great results✅.
Good luck!🤞
🔥14❤6
A exam. 20 points problem:
int** createMatrix(int rows, int cols) {
int** matrix = new int*[rows];
for (int i = 0; i < rows; i++) {
matrix[i] = new int[cols];
}
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
matrix[i][j] = i + j;
}
}
return matrix;
}❤2
A exam. 10-point problem
#include <iostream>
using namespace std;
int lcm(int num1, int num2) {
int a = num1;
int b = num2;
while (b>0) {
a = a%b;
int temp = b;
b = a;
a = temp;
}
return num1*num2/a;
}
int main() {
cout << lcm(48,18);
return 0;
}
❤4
‼️Guys‼️
Can anyone send me complete and clear questions of B examʼs coding part?
Can anyone send me complete and clear questions of B examʼs coding part?
❤5
Computer Programming 1 Videos
Lesson 1: C++ Basics: Integers, Program Structure, and Math Library
Lesson 2: Boolean
Lesson 3: Conditional Statements in C++ (if–else, switch)
Lesson 4: For and while loops
Lesson 5: Functions
Lesson 6: Hard problems
Lesson 7: Arrays
Lesson 8: Matrix and Vectors
Lesson 9: *Pointers
Lesson 10: File Handling
Telegram
Computer Programming
🎥Lesson 1
💻C++ Programming
🔖Extra Session - Midterm Preparation
#cpp
💻C++ Programming
🔖Extra Session - Midterm Preparation
#cpp
🔥5❤4
Labs.zip
2.8 MB
🔥8👍2❤1
This media is not supported in the widget
VIEW IN TELEGRAM
🔥3
Computer Programming pinned «Computer Programming 1 Videos Lesson 1: C++ Basics: Integers, Program Structure, and Math Library Lesson 2: Boolean Lesson 3: Conditional Statements in C++ (if–else, switch) Lesson 4: For and while loops Lesson 5: Functions Lesson 6: Hard problems Lesson…»
