TGINSIGHT CHAT
Computer Programming
@cpp_sirius
Education- Programming Lessons - Daily problems - Guide books Murojaat: @asadbek_tolqinjonov
Siste innlegg
Side 21 av 33 · 395 innlegg
Publisert 6. okt.
For sikl operatori uchun qoʻllanma #cpp @cpp_sirius👨💻
Hashtags
Publisert 6. okt.
Lesson 4 codes #cpp
Hashtags
Publisert 6. okt.
🔖Extra Session - Midterm Preparation 🎥Lesson 4 💻C++ Programming 🧩Topics: — for, while loop statemets #cpp @cpp_sirius👨💻
Hashtags
Publisert 6. okt.
Live stream finished (1 hour)
Publisert 6. okt.
Darsimiz yaxshi bo'ldimi? Yaxshi🔥
Publisert 6. okt.
Savollaring?
Publisert 6. okt.
// Problem 8 // n = 12345 = 1*10000 + 2*1000 + 3*100 + 4*10 + 5 // r = 54321 = 5*10000 + 4*1000 + 3*100 + 2*10 + 1 // reverse = n%10 // reverse = reverse * 10 int n, reverse = 0; cout<<"Enter the number: "; cin>>n; while (n!=0) { reverse *= 10; reverse += n%10; n = n/10; } cout<<reverse;
Publisert 6. okt.
// Problem 7 // Prime or not? // input: number // output: yes or no // prime: 2 ta bo'luvchisi bo'lishi shart: 1 va o'zi int n, counter = 0; cout<<"Enter a number: "; cin>>n; for (int i=1; i<=n/2; i++) if (n%i==0) counter++; if (counter==1) cout<<"Number is prime"; else cout<<"Number is not prime";
Publisert 6. okt.
// Problem 6 // Total GPA? // input: number of classes - fanlar soni - 5 ta ASC, FP, CP, DT, Cal // input: credits for subject CP - 8 // input: total mark; mark - 4 // totalGPA = (credit*mark+creditofCP*mark)/totalCredit // totalGPA = (3*4.5 + 2*3.5 + 1*4.5)/(3+2+1) = (13.5+7+4.5)/6 = 25 / 6 = 4.1666 // totalGPA = totalMark/totalCredit // float n, credit, mark, totalMark = 0, totalCredit = 0; // cout<<"Enter the number of subjects: "; cin>>n; // for (int i=1; i<=n; i++) { // cout<<"Enter credits and mark: "; cin>>credit>>mark; // totalCredit += credit; // totalMark += credit*mark; // } // float totalGPA = totalMark/totalCredit; // cout<<"Total GPA: "<<totalGPA<<endl;
Publisert 6. okt.
Tushunarli bo'layaptimi?
Publisert 6. okt.
// Problem 5 // Uppercase - A, B, W, U, T // Lowercase - a, b, w, u, t // for (int i=65; i<=90; i++) { // if (i%5==0 and i!=65) cout<<endl; // cout<<char(i)<<" "; // } // 65, 66, 67, 68, 69 // 70, 71, 72, 73, 74 // 75
Publisert 6. okt.
// Problem 4 // int n; // cout<<"n = "; cin>>n; // for (int i=1; i<=n; i++) if (i%10==0) cout<<i<<" ";