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

Murojaat: @asadbek_tolqinjonov
Download Telegram
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;
}
😭91
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;
}
😭113
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
Student's Assessment

#cp1
@cpp_sirius🧑🏻‍💻
Channel name was changed to «C++ Programming»
🧩According to Syllabus

Week 9 - Recursion🔁
2
Recursion.pdf
8.4 KB
Recursion Guide

#cp1 #cpp

@cpp_sirius🧑🏻‍💻
4
Reverse of the number by Recursion

#cp1 #cpp
@cpp_sirius👨‍💻
#cpp

🗼Tower of Hanoi by Recursion (Problem 12)

@cpp_sirius👨‍💻
Array_1_Guide.pdf
11.5 KB
Array 1 Guide

#cpp

@cpp_sirius👨‍💻
2
Forwarded from Computer Programming 1
week10.1.pdf
90.9 KB
2
Forwarded from Computer Programming 1
Homework tasks
2
Which problem do you want us to solve
Computer Programming 1
week10.1.pdf
Problem 5 Solution

#cpp