Pointers:
Lvalue, Rvalue
* & operators
Pointers to Array
Matrix Pointers
Lvalue, Rvalue
* & operators
Pointers to Array
Matrix Pointers
// <----------pointer to pointer-------->
// int c = 12;
// int *cptr = &c;
// cout << &c << endl;
// cout << cptr << endl<<endl;
// int **ccptr = &cptr;
// cout << &cptr << endl;
// cout << ccptr << endl;
// int c = 12;
// int *cptr = &c;
// cout << &c << endl;
// cout << cptr << endl<<endl;
// int **ccptr = &cptr;
// cout << &cptr << endl;
// cout << ccptr << endl;
❤1
🗣COMPUTER PROGRAMMING MOCK
🎓 Attention Students!
Due to final exam is near, we are organizing a mock exam from Computer Programming 1.
🗓 Saturday, 6th December
⏰2:00 PM
📍M.A.T.H building
Please fill out the form here👇
📃Form link
Good luck🤞
@cpp_sirius👨💻
🎓 Attention Students!
Due to final exam is near, we are organizing a mock exam from Computer Programming 1.
🗓 Saturday, 6th December
⏰2:00 PM
📍M.A.T.H building
Please fill out the form here👇
📃Form link
Good luck🤞
@cpp_sirius👨💻
❤6🔥2
Computer Programming
🗣COMPUTER PROGRAMMING MOCK 🎓 Attention Students! Due to final exam is near, we are organizing a mock exam from Computer Programming 1. 🗓 Saturday, 6th December ⏰2:00 PM 📍M.A.T.H building Please fill out the form here👇 📃Form link Good luck🤞 @cpp_sirius👨💻
📢 Registration Deadline Announcement
Dear students,
Please note that the deadline to complete the C++ Mock Test registration form is:
‼️If you have not filled out the form yet, please do so before the deadline.
👉 Form Link
Thank you!
Dear students,
Please note that the deadline to complete the C++ Mock Test registration form is:
🗓 Thursday, 4th December
⏰ Until 23:59
‼️If you have not filled out the form yet, please do so before the deadline.
👉 Form Link
Thank you!
❤7
Should we conduct a lesson about File Handling?
Yes ♥️
No, I don't have time 😐
Yes ♥️
No, I don't have time 😐
❤23
Computer Programming
🗣COMPUTER PROGRAMMING MOCK 🎓 Attention Students! Due to final exam is near, we are organizing a mock exam from Computer Programming 1. 🗓 Saturday, 6th December ⏰2:00 PM 📍M.A.T.H building Please fill out the form here👇 📃Form link Good luck🤞 @cpp_sirius👨💻
🎓Dear students!
🙏🏻We kindly ask you to bring some(2 or 3) white papers with you just in case
🙏🏻We kindly ask you to bring some(2 or 3) white papers with you just in case
❤7
Students!
We wil hold the exam in 205 MATH
We wil hold the exam in 205 MATH
👍2
Does anyone want to participate in review?
Come to 205
Come to 205
👍3😢2
#include <iostream>
#include <cmath>
#include <fstream>
using namespace std;
int calculate(int, int);
void swap(int* a, int* b) {
*a = *a+*b;
*b = *a-*b;
*a = *a-*b;
}
void checkEven(int *num) {
if (*num % 2 == 0) {
*num = 0;
}
}
void writeLog() {
ofstream outputFile("log.txt");
if (outputFile.is_open()) {
outputFile << "Finished";
outputFile.close();
}
}
void printMatrix(int matrix[2][3]) {
for (int i = 0; i < 2; i++) {
for (int j=0; j < 3; j++) {
cout << matrix[i][j] << " ";
}
cout << endl;
}
}
int main() {
// bool flag = true;
// int j=5;
// for (j; j<10 and flag; j++) {
// if (j==7) {
// flag = false;
// }
// cout << j << " ";
// }
// not !
// or ||
// and &&
// ifstream inFile("input.txt");
// string word;
// while (inFile >> word) {
// cout << word <<endl;
// }
// ifstream inFile("input.txt");
// string word;
// while (getline(inFile, word)) {
// cout << word <<endl;
// }
// int x = 10;
// checkEven(&x);
// cout<<x;
// p1
// int score = 75;
// if (score>=60) {
// cout<<"Pass";
// }else {
// cout<<"Fail";
// }
// p2
// int i = 10;
// do {
// cout << " "<< i;
// i--;
// }while (i>=7);
// p3
// int a=3, b=4;
// int result = calculate(a, b);
// cout << result << endl;
// p4
// int data[] = {10, 20, 30};
// int sum = 0;
// for (int i=0; i<sizeof(data)/sizeof(int); i++) {
// sum += data[i];
// }
// cout << sum << endl;
// p5
// bool is_raining = true;
// double d=9.8;
// if (!is_raining) {
// cout<<"Sun";
// }else {
// int x = int(d);
// cout<<x;
// }
// double d = 9.17;
// int x = round(d);
// cout<<x<<endl;
// p6
// int num = 42;
// int *ptr = #
// cout<<*ptr;
// p7
// int **arr = new int *[5];
// arr[2] = new int[50];
// delete[] arr;
// p9
// int val = 10;
// int val2 = 20;
// int const * const p = &val;
// p = &val2;
// cout<<&val<<endl;
// cout<<p;
// code 2
// int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9};;
// int *ptr = arr;
// int max = *arr;
// for (int* i = arr; i < arr+10; i++) {
// if (*i > max) {
// max = *i;
// }
// }
// int max2 = *ptr;
// for (int* i=arr; i < arr+10; i++) {
// if (*i>max2 and *i<max) {
// max2 = *i;
// }
// }
// cout << max2 << endl;
// sorting
// int n; cout<<"Enter the size of array: "; cin>>n;
// int arr[n];
// for (int i = 0; i < n; i++) {
// cin>>arr[i];
// }
// int *ptr = arr;
// for (int i = 1; i < n; i++) {
// for (int j = 1; j < n; j++) {
// if (*(ptr+j)<*(ptr+j-1)) {
// swap(ptr+j, ptr+j-1);
// }
// }
// }
// int max2 = *(ptr+n-2);
// cout << max2 << endl;
// 3-usul
// int arr2[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9};
// int *ptr = arr2;
// int max1 = *ptr;
// int max2 = 0;
// for (int i = 0; i < 10; i++) {
// if (max1 < *(ptr+i)) {
// max2 = max1;
// max1 = *(ptr+i);
// }
// }
// cout<<max2<<endl;
return 0;
}
int calculate(int x, int y) {
return x*x + y;
}
#include <cmath>
#include <fstream>
using namespace std;
int calculate(int, int);
void swap(int* a, int* b) {
*a = *a+*b;
*b = *a-*b;
*a = *a-*b;
}
void checkEven(int *num) {
if (*num % 2 == 0) {
*num = 0;
}
}
void writeLog() {
ofstream outputFile("log.txt");
if (outputFile.is_open()) {
outputFile << "Finished";
outputFile.close();
}
}
void printMatrix(int matrix[2][3]) {
for (int i = 0; i < 2; i++) {
for (int j=0; j < 3; j++) {
cout << matrix[i][j] << " ";
}
cout << endl;
}
}
int main() {
// bool flag = true;
// int j=5;
// for (j; j<10 and flag; j++) {
// if (j==7) {
// flag = false;
// }
// cout << j << " ";
// }
// not !
// or ||
// and &&
// ifstream inFile("input.txt");
// string word;
// while (inFile >> word) {
// cout << word <<endl;
// }
// ifstream inFile("input.txt");
// string word;
// while (getline(inFile, word)) {
// cout << word <<endl;
// }
// int x = 10;
// checkEven(&x);
// cout<<x;
// p1
// int score = 75;
// if (score>=60) {
// cout<<"Pass";
// }else {
// cout<<"Fail";
// }
// p2
// int i = 10;
// do {
// cout << " "<< i;
// i--;
// }while (i>=7);
// p3
// int a=3, b=4;
// int result = calculate(a, b);
// cout << result << endl;
// p4
// int data[] = {10, 20, 30};
// int sum = 0;
// for (int i=0; i<sizeof(data)/sizeof(int); i++) {
// sum += data[i];
// }
// cout << sum << endl;
// p5
// bool is_raining = true;
// double d=9.8;
// if (!is_raining) {
// cout<<"Sun";
// }else {
// int x = int(d);
// cout<<x;
// }
// double d = 9.17;
// int x = round(d);
// cout<<x<<endl;
// p6
// int num = 42;
// int *ptr = #
// cout<<*ptr;
// p7
// int **arr = new int *[5];
// arr[2] = new int[50];
// delete[] arr;
// p9
// int val = 10;
// int val2 = 20;
// int const * const p = &val;
// p = &val2;
// cout<<&val<<endl;
// cout<<p;
// code 2
// int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9};;
// int *ptr = arr;
// int max = *arr;
// for (int* i = arr; i < arr+10; i++) {
// if (*i > max) {
// max = *i;
// }
// }
// int max2 = *ptr;
// for (int* i=arr; i < arr+10; i++) {
// if (*i>max2 and *i<max) {
// max2 = *i;
// }
// }
// cout << max2 << endl;
// sorting
// int n; cout<<"Enter the size of array: "; cin>>n;
// int arr[n];
// for (int i = 0; i < n; i++) {
// cin>>arr[i];
// }
// int *ptr = arr;
// for (int i = 1; i < n; i++) {
// for (int j = 1; j < n; j++) {
// if (*(ptr+j)<*(ptr+j-1)) {
// swap(ptr+j, ptr+j-1);
// }
// }
// }
// int max2 = *(ptr+n-2);
// cout << max2 << endl;
// 3-usul
// int arr2[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 9};
// int *ptr = arr2;
// int max1 = *ptr;
// int max2 = 0;
// for (int i = 0; i < 10; i++) {
// if (max1 < *(ptr+i)) {
// max2 = max1;
// max1 = *(ptr+i);
// }
// }
// cout<<max2<<endl;
return 0;
}
int calculate(int x, int y) {
return x*x + y;
}
❤1👍1
Computer Programming
mock_final102.pdf
Guys!
I tried my best to prepare this mock.
However, I can not say the real exam will be exactly like this.
So do not think this is a real exam
I tried my best to prepare this mock.
However, I can not say the real exam will be exactly like this.
So do not think this is a real exam
❤8🔥6🕊2