Switch_case.pdf
616.6 KB
π₯1
Assalamu alaykum, guysβΌοΈ
Should we conduct a lesson tomorrow?
Yes π―
No π
Should we conduct a lesson tomorrow?
Topic:
β for, while loop statements
Yes π―
No π
π―20π5β€1
βΌοΈExtra Sessions for Midterm PreparationβΌοΈ
Today we are going to organize an online lesson
β Be ready
@cpp_siriusπ¨βπ»
Today we are going to organize an online lesson
π» C++ Programming
β° Time: 21:00
Topic:
β for, while loop statements
β Be ready
@cpp_siriusπ¨βπ»
β€3
Computer Programming
Photo
// Sikl - takrorlanish, aylanish
// for (<ifoda1>; <ifoda2>; <ifoda3>)
// operator;
// 1-10
// <ifoda1> - boshlang'ich qiymat;
// <ifoda2> - aylanish sharti;
// <ifoda3> - o'zgarish;
// operator - sikl tansi -> hisoblash
// for (<ifoda1>; <ifoda2>; <ifoda3>)
// operator;
// 1-10
// <ifoda1> - boshlang'ich qiymat;
// <ifoda2> - aylanish sharti;
// <ifoda3> - o'zgarish;
// operator - sikl tansi -> hisoblash
// Misol: 1dan 10gacha sonlarni chiqarish; 11da to'xtashi kerak
// bosh qiy = 1
// for (int i=1; i<=10; i++)
// cout<<i<<" ";
// bosh qiy = 1
// for (int i=1; i<=10; i++)
// cout<<i<<" ";
// b dan a gacha chiqarish - kamayuvchi sikl
// 100 sikl to'xtasin
// 1000 - 12
// int a, b; cin>>a>>b;
// for (int i=b; i>=a; i--) {
// if (i==100) {
// break; //siklni to'xtatadi
// }
// cout << i << " ";
// }
// 100 bo'sa, 100 ni chiqarmaslik kerak
// int a, b; cin>>a>>b;
// for (int i=b; i>=a; i--) {
// if (i==100) {
// continue; // keyin takrorlanishga o'tiladi - skip
// }
// cout << i << " ";
// }
// 100 sikl to'xtasin
// 1000 - 12
// int a, b; cin>>a>>b;
// for (int i=b; i>=a; i--) {
// if (i==100) {
// break; //siklni to'xtatadi
// }
// cout << i << " ";
// }
// 100 bo'sa, 100 ni chiqarmaslik kerak
// int a, b; cin>>a>>b;
// for (int i=b; i>=a; i--) {
// if (i==100) {
// continue; // keyin takrorlanishga o'tiladi - skip
// }
// cout << i << " ";
// }
// Problem 4
// int n;
// cout<<"n = "; cin>>n;
// for (int i=1; i<=n; i++) if (i%10==0) cout<<i<<" ";
// int n;
// cout<<"n = "; cin>>n;
// for (int i=1; i<=n; i++) if (i%10==0) cout<<i<<" ";