Repetition Control Structures | With C++

Поділитися
Вставка
  • Опубліковано 10 вер 2024
  • This video focuses on Repetition Control Structures such as While loop, do While loop, for loop, Nested for loop and Sentinel Control loop. These Concepts are explained in Sinhala using C++ Programming Language.
    #repetition #controlstructures #loops #while #whileloops #dowhileloop #forloop #for #nestedforloop #sentinel #c #c++

КОМЕНТАРІ • 3

  • @SithijaDilshan-23
    @SithijaDilshan-23  Місяць тому +2

    #include
    using namespace std;
    int main() {
    int type, quantity;
    float discount, price, total = 0;
    cout > type;
    while (type != -1) {
    total = 0;
    cout > quantity;
    if (type == 1) {
    price = 1000.00;
    discount = 10;
    }
    else if (type == 2) {
    price = 1600.00;
    discount = 12;
    }
    else if (type == 3) {
    price = 1400.00;
    discount = 15;
    }
    if (quantity > 3) {
    total = quantity * price;
    total = total - (total * discount / 100);
    }
    else {
    total = quantity * price;
    }
    cout

  • @yanithravidu8100
    @yanithravidu8100 Місяць тому

    🎉