Thread: use of "for loops"

  1. #16
    Registered User
    Join Date
    Oct 2008
    Posts
    5
    this is the solution and i accept any one comment on my codes
    int n;
    cin >> n;
    for(int i=1; i<n+1 ;i++)
    {cout << endl;
    for(int j=1; j<i+1; j++)
    cout << i;
    }

    if im not mistaken this person is not asking this solution for homework but for his/her own stdy
    because this same Q i have it in my tutorial
    and after one day only we r having final exam << so scared

    actually i agree not posting solutions only and only because of cheating
    otherwise why not?
    maybe some1 will say spoonfeeding
    so why not
    i agree with spoonfeeding the information and knowlage especially for begging so will have a strong foundation within short time
    lets save this time and energy for what no one knows about

  2. #17
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> if im not mistaken this person is not asking this solution for homework but for his/her own stdy <<
    Unfortunately there's no way to know that for sure, so the policy is, don't give out solutions at all.

    >> i agree with spoonfeeding the information and knowlage <<
    Learning to program isn't about learning the correct syntax, it's about learning about how to approach a problem. Providing correct syntax does little to help the person learn how to approach the problem. It also prevents the person from gaining the experience that comes from approaching a problem from the wrong perspective and figuring out what went wrong.

    Complete examples don't provide any benefits that walking a person through completion of the problem can't also provide.

  3. #18
    C++Pandit
    Join Date
    Jul 2008
    Posts
    49
    just take this code
    and turn this in
    Code:
    #include<iostream>
    #include<conio.h>
    #include<iomanip>
    using namespace std;
    int main()
    {
        char a;
        int b=0;
        for(a=49;a<54;a++)
        {
                        b++;                        
                        cout<<setfill(a)<<setw(b)<<a<<endl;
                        
                        }
                        _getch();
                        }
    I would rather be hated for who I am than be loved for who I am not!

  4. #19
    C++Pandit
    Join Date
    Jul 2008
    Posts
    49
    Quote Originally Posted by digital artist View Post
    this is the solution and i accept any one comment on my codes



    if im not mistaken this person is not asking this solution for homework but for his/her own stdy
    because this same Q i have it in my tutorial
    and after one day only we r having final exam << so scared

    actually i agree not posting solutions only and only because of cheating
    otherwise why not?
    maybe some1 will say spoonfeeding
    so why not
    i agree with spoonfeeding the information and knowlage especially for begging so will have a strong foundation within short time
    lets save this time and energy for what no one knows about
    digital artist.i dont take part in any c++ exams , i learn c++ just to be creative and not to cheat.
    I would rather be hated for who I am than be loved for who I am not!

Popular pages Recent additions subscribe to a feed