Computer Programming
262 subscribers
58 photos
15 videos
55 files
16 links
- Programming Lessons
- Daily problems
- Guide books

Murojaat: @asadbek_tolqinjonov
Download Telegram
Sizlarda problems bormi?
Live stream finished (1 hour)
If you have any questions
Write @asadbek_tolqinjonov
Media is too big
VIEW IN TELEGRAM
πŸŽ₯Lesson 6
πŸ’»C++ Programming
🧩Hard Problems

#cpp

@cpp_siriusπŸ‘¨β€πŸ’»
Sikl operatorlari.pdf
1.4 MB
For-while.

Problemsβœ…

@cpp_siriusπŸ‘¨β€πŸ’»
Terminal Commands
‼️ Attention

We asked professor to give last year's midterm questions from CP1. But Prof doesn't want to give.
🀬7
Good luck to everyone on today’s exam!

Ace the testπŸ™Œ
❀8
Part 3.


Problem 1
Write a function that prints 100 random numbers

Problem 2
Write a function that calculates average grade of students

Problem 3
Write a function to find gcd of two numbers. Header should be like this: int gcd(int num1, int num2)
❀3
Computer Programming
Part 3. Problem 1 Write a function that prints 100 random numbers Problem 2 Write a function that calculates average grade of students Problem 3 Write a function to find gcd of two numbers. Header should be like this: int gcd(int num1, int num2)
//gcd



#include <iostream>
using namespace std;

int gcd(int num1, int num2) {
while (num2 != 0) {
int temp = num2;
num2 = num1 % num2;
num1 = temp;
}
return num1;
}

int main() {
int a, b;
cout << "Enter two numbers: ";
cin >> a >> b;
cout << "GCD = " << gcd(a, b);
return 0;
}
😭9❀1
Computer Programming
Part 3. Problem 1 Write a function that prints 100 random numbers Problem 2 Write a function that calculates average grade of students Problem 3 Write a function to find gcd of two numbers. Header should be like this: int gcd(int num1, int num2)
// Problem 1


#include <iostream>
#include <cstdlib> // rand(), srand()
#include <ctime> // time()
using namespace std;

int main() {
srand(time(0)); // Har safar boshqa natija chiqishi uchun

for (int i = 0; i < 100; i++) {
cout << rand() << " ";
}

return 0;
}
😭11❀3
Computer Programming
Part 3. Problem 1 Write a function that prints 100 random numbers Problem 2 Write a function that calculates average grade of students Problem 3 Write a function to find gcd of two numbers. Header should be like this: int gcd(int num1, int num2)
// Problem 2


#include <iostream>
using namespace std;

int main() {
int n, grade, sum=0;
cout << "Enter the number of students(1-100): "; cin>>n;
for (int i = 1; i <= n; i++) {
cout<<"Enter the grade of student "<<i<<" (0-100): "; cin>>grade;
sum+=grade;
}
cout<<"Average grade: "<<sum/n;

return 0;
}
❀3
Computer Programming 1.pdf
477.3 KB
Course Syllabus Fall 2025

Computer Programming 1
CS102

#cp1
πŸ‘2