Loops in C++
(While Loop)
Q1. write a program in C++. your program should print all the Even numbers from 0-100 on the console screen?

Q2. write a program in C++. your program should print A-Z on the console?

Q3. write a program in C++. your program should print the Multiple of 3 from 0-100 range on the console?

Q4. write a program in C++ print "All Good" infinite time on the console?

For help:
                    Help Me 
Submission: 
                         Click for Submission 


35 Comments

  1. Question # 1

    #include
    using namespace std;
    void main()
    {
    int a=0;
    while(a<=100)
    {
    if(a%2==0)
    {
    cout<<a<<endl;
    }
    a++;
    }
    system("pause");
    }

    Muhammad Bilal
    Section A2
    CMS # 406670

    ReplyDelete
  2. Question # 2

    #include
    using namespace std;
    void main()
    {
    char ch='A';
    while(ch<='Z')
    {
    cout<<ch<<endl;
    ch++;
    }
    system("pause");
    }

    Muhammad Bilal
    Section A2
    CMS # 406670

    ReplyDelete
  3. #include
    using namespace std;
    int main()
    {
    int a=0;
    while(a<=100)
    {
    if(a%2==0)
    {
    cout<<a<<endl;
    }
    a++;
    }
    system("pause");
    return 0;
    }
    Name :Muhammad Wasif Nazir
    class :section A1
    cms no406084.

    ReplyDelete
  4. Question # 4

    #include
    using namespace std;
    void main()
    {
    while( 1&& (1||(-100)))
    {
    cout<<"Good"<<endl;
    }
    system("pause");
    }

    Muhammad Bilal
    Section A2
    CMS # 406670

    ReplyDelete
  5. Question 2
    #include
    using namespace std;
    int main()
    {
    char ch='A';
    while(ch<='Z')
    {
    cout<<ch<<endl;
    ch++;
    }
    system ("pause");
    return 0;
    }
    Name:Muhammad Wasif Nazir
    class:section A1
    cms no.406084

    ReplyDelete
  6. Question # 3

    #include
    using namespace std;
    void main()
    {
    int a=0;
    while(a<=100)
    {
    if(a%3==0)
    {
    cout<<a<<endl;
    }
    a++;
    }
    system("pause");
    }

    Muhammad Bilal
    Section A2
    CMS # 406670

    ReplyDelete
  7. question 3
    #include
    using namespace std;
    int main()
    {
    while(a<=100)
    {
    if(a%3==0)
    {
    cout<<a<<endl;
    }
    a++;
    }

    system("pause");
    return 0;
    }
    Name :muhammad wasif nazir.
    class :section A1
    cms no:406084

    ReplyDelete
  8. Question 4
    #include
    using namespace std;
    int main()
    {
    while( 1&& (1||(-100)))
    {
    cout<<"Good"<<endl;
    }
    system("pause");
    return 0;
    }

    name :Muhammad wasif nazir
    class :section A1
    cms no:406084

    ReplyDelete
  9. #include
    using namespace std;
    void main()
    {
    int a=0;
    while(a<=100)
    {
    if(a%2==0)
    {
    cout<<a<<endl;
    }
    a++;
    }
    system("pause");
    }
    ALI HASNAIN
    CMS 405643
    question 2

    #include
    using namespace std;
    void main()
    {
    char ch='A';
    while(ch<='Z')
    {
    cout<<ch<<endl;
    ch++;
    }
    system("pause");
    }
    ali hasnain
    cms 405643

    ReplyDelete
  10. #include
    using namespace std;
    int main()
    {
    while( 1&& (1||(-100)))
    {
    cout<<"Good"<<endl;
    }
    system("pause");
    return 0;
    }
    ali hasnain
    cms 405643
    saction a1

    ReplyDelete
  11. Q#1:
    #include
    using namespace std;
    void main()
    {
    int num=0;
    cout<<"The even numbers between 0 to 100 is:"<<"\n";
    while(num>=0 && num<=100)
    {
    cout<<num<<"\n";
    num+=2;
    }
    system("pause");
    }
    Sarmad Hassan
    CMS#406324
    Section:A2

    ReplyDelete
  12. Q no:1

    #include
    using namespace std;
    void main()
    {
    int a=0;
    cout<<"the even numbers between 0 to 100 is:"<<"\n";
    while(a>=0 && a<=100)
    {
    cout<<a<<"\n";
    a=a+2;
    }
    system("pause");
    }

    Abdul Rehman

    Cms:406311

    ReplyDelete
  13. Question No 1:
    #include
    using namespace std;
    void main()
    {
    int a=0;
    cout<<"All even numbers from 0-100"<<"\n";
    while(a>=0 && a<=100)
    {
    cout<<a<<"\n";
    a=a+2;
    }
    system("pause");
    }

    Madni Fareed
    CMS#406323

    ReplyDelete
  14. #include
    using namespace std;
    int main()
    {
    int s=0;
    cout<<"the even numbers between 0 to 100"<<"\n";
    while(s<=100 && s>=0)
    {
    cout<<s<<"\n";
    s=s+2;
    }
    system("pause");
    return 0;
    }
    Saim Bashir
    406979
    A2

    ReplyDelete
  15. Q#2:
    #include
    using namespace std;
    void main()
    {
    char alpha='A';
    cout<<"The A-Z alphabets are:"<<"\n";
    while(alpha>=65 && alpha<=90)
    {
    cout<<alpha<<"\n";
    alpha++;
    }
    system("pause");
    }
    Sarmad Hassan
    CMS#406324
    Section:A2

    ReplyDelete
  16. Q no:2
    #include
    using namespace std;
    void main()
    {
    char alpha='A';
    cout<<"the A-Z alphabets are:"<<"\n";
    while(alpha>=65 && alpha<=90)
    {
    cout<<alpha<<"\n";
    alpha++;
    }
    system("pause");
    }

    Abdul Rehman
    CMS:406311
    A2

    ReplyDelete
  17. Q#3:
    #include
    using namespace std;
    void main()
    {
    int num=3;
    cout<<"The multiple of 3 between 0 to 100 are:"<<"\n";
    while(num>=3 && num<=100)
    { cout<<num<<"\n";
    num+=3;
    }
    system("pause");
    }
    Sarmad hassan
    CMS#406324
    Section:A2

    ReplyDelete
  18. Question No:2
    #include
    using namespace std;
    void main()
    {
    char a=65;
    cout<<"All characters from A-Z"<<"\n";
    while(a>=65 && a<=90)
    {
    cout<<a<<"\n";
    a++;
    }
    system("pause");
    }

    Madni Fareed
    CMS#406323
    Section : A2

    ReplyDelete
  19. #include
    using namespace std;
    int main()
    {
    char a=65;
    cout<<"all character from A-Z"<<"\n";
    while(a>=65 && a<=90)
    {
    cout<<a<<"\n";
    a++;
    }

    system("pause");
    return 0;
    }
    Saim Bashir
    406979
    A2

    ReplyDelete
  20. Q no:3
    #include
    using namespace std;
    void main()
    {
    int num=3;
    cout<<"the multiple of 3 between 0 to 100 are:"<<"\n";
    while(num>=3 && num<=100)
    {
    cout<<num<<"\n";
    num+=3
    }
    system("pause");
    }

    Abdul Rehman
    CMS:406311
    A2

    ReplyDelete
  21. Q#4:
    #include
    using namespace std;
    void main()
    {

    while(1&&1)
    {
    cout<<"All Good"<<"\n";

    }
    system("pause");
    }
    Sarmad Hassan
    CMS#406324
    Section:A2

    ReplyDelete
  22. Question No:3

    #include
    using namespace std;
    void main()
    {
    int x=3;
    cout<<"The Multiple of 3 from 0-100="<<"\n";
    while(x>=3 && x<=100)
    {
    cout<<x<<"\n";
    x=x+3;
    }
    system("pause");
    }

    Madni Fareed
    CMS#406323
    Section : A2

    ReplyDelete
  23. #include
    using namespace std;
    int main()
    {
    int a=3;
    cout<<"the multiple of 3 from 0 to 100"<<"\n";
    while(a>=3 && a<=100)
    {
    cout<<a<<"\n";
    a=a+3;
    }

    system("pause");
    return 0;
    }
    Saim Bashir
    406979
    A2

    ReplyDelete
  24. Q no:4
    #include
    using namespace std;
    void main()
    {
    while(1&&1)
    {
    cout<<all good"<<"\n";
    }
    system("pause");
    }
    Abdul Rehman
    CMS:406311
    A2

    ReplyDelete
  25. Question No:4

    #include
    using namespace std;
    void main()
    {
    while(1)
    {
    cout<<"All Good";
    }
    system("pause");
    }

    Madni Fareed
    CMS#406323
    Section: A2

    ReplyDelete
  26. Q1. write a program in C++. your program should print all the Even numbers from 0-100 on the console screen?

    #include
    using namespace std;
    void main()
    {
    int a = 0;
    while (a <= 100)
    {
    cout << a << "\n";
    a = a + 2;
    }

    }
    Q2. write a program in C++. your program should print A-Z on the console?

    #include
    using namespace std;
    void main()
    {
    char a = 'A';
    while (a <= 'Z')
    {
    cout << a << "\n";
    a++;
    }
    }

    Q3. write a program in C++. your program should print the Multiple of 3 from 0-100 range on the console?

    #include
    using namespace std;
    void main()
    {
    int a = 1
    ;
    while (a <= 100)
    {
    cout <<"multiple of 3 = " << a << "\n";
    a=a*3;
    }

    }

    Q4. write a program in C++ print "All Good" infinite time on the console?

    #include
    using namespace std;
    void main()
    {
    int a = 1;

    while (a != 100)
    {
    cout << "ALL GOOD " << "\n";
    }
    }
    Name; FAIZAN AHMAD
    CMS;406201
    A2

    ReplyDelete
  27. #include
    using namespace std;
    int main()
    {
    while(1)
    {
    cout<<"all Good";
    }
    system("pause")
    return 0 ;
    }
    saim bashir
    406979
    A2

    ReplyDelete
  28. Q1. write a program in C++. your program should print all the Even numbers from 0-100 on the console screen?

    #include
    using namespace std;
    void main()
    {
    int a = 0;
    while (a <= 100)
    {
    cout << a << "\n";
    a = a + 2;
    }

    }
    Q2. write a program in C++. your program should print A-Z on the console?

    #include
    using namespace std;
    void main()
    {
    char a = 'A';
    while (a <= 'Z')
    {
    cout << a << "\n";
    a++;
    }
    }

    Q3. write a program in C++. your program should print the Multiple of 3 from 0-100 range on the console?

    #include
    using namespace std;
    void main()
    {
    int a = 1
    ;
    while (a <= 100)
    {
    cout <<"multiple of 3 = " << a << "\n";
    a=a*3;
    }

    }

    Q4. write a program in C++ print "All Good" infinite time on the console?

    #include
    using namespace std;
    void main()
    {
    int a = 1;

    while (a != 100)
    {
    cout << "ALL GOOD " << "\n";
    }
    }
    name:laiq ahmed
    cms :406985
    A2

    ReplyDelete
  29. #include
    using namespace std;
    int main()
    {
    int x=0;
    while (x<=100)
    {
    if(x%2==0)
    {
    cout << x <<endl;
    }
    x=x+1;
    }
    system("pause");
    }
    MUHAMMAD UMAIR ANJUM
    CMS NO: 406266
    SECTION A2

    ReplyDelete
  30. #include
    using namespace std;
    int main()
    {
    char ch='A';
    while (ch<='Z')
    {
    cout << ch << endl;
    ch=ch+1;
    }
    system ("pause");
    }
    MUHAMMAD UMAIR ANJUM
    CMS NO: 406266
    SECTION A2

    ReplyDelete
  31. #include
    using namespace std;
    int main()
    {
    int x=0;
    while (x<=100)
    {
    if(x%3==0)

    {
    cout << x << endl;
    }
    x=x+1;
    }
    system("pause");
    }
    MUHAMMAD UMAIR ANJUM
    CMS NO: 406266
    SECTION A2

    ReplyDelete
  32. #include
    using namespace std;
    int main()
    {
    while (1 && (1||(-100)))
    {
    cout << "GOOD" <<endl;
    }
    }

    MUHAMMAD UMAIR ANJUM
    CMS NO: 406266
    SECTION A2

    ReplyDelete
  33. #include
    using namespace std;
    int main()
    {
    int a=0;
    while(a<=100)
    {
    if(a%2==0)
    {
    cout<<a<<endl;
    }
    a++;
    }
    system("pause");
    return 0;
    }

    Ijaz Ali Shah
    A1
    CMS 407261

    ReplyDelete
  34. #include
    using namespace std;
    int main()
    {
    char ch = 'A';
    while (ch <= 'Z')
    {
    cout << ch << endl;

    ch++;
    }
    system("pause");
    return 0;
    }
    Ijaz Ali shah

    Section:A1

    CMS:407261

    ReplyDelete
  35. #include
    using namespace std;
    int main()
    {
    int a = 0;
    while (a <= 100)
    {
    if (a % 3 == 0)
    {
    cout << a << endl;
    }
    a++;
    }
    system("pause");
    }
    Ijaz Ali shah

    Section :A1

    CMS: 407261

    ReplyDelete

Post a Comment

Previous Post Next Post