Help me in this C program!

Can somebody please write this program in C language!
6 answers Last reply
More about help program
  1. No. Not going to do your homework for you. it's for your own good in the long run.
  2. Ijack said:
    No. Not going to do your homework for you. it's for your own good in the long run.


    +1
  3. @Ijack Can you atleast give me some hints for eg I think I will be able to do it using while loop. Am I right?
  4. hussanali said:
    @Ijack Can you atleast give me some hints for eg I think I will be able to do it using while loop. Am I right?


    @hussanali

    this code is incomplete, some of the alphabets loop needs modification ....though I think you can continue from here...will update if I got it in the meantime....

    first run this and check the result....trying C++ again after leaving college 7 years back....so :D

    #include<iostream.h>
    #include<conio.h>

    int main()
    {
    int i,j,k,l;
    char letter;
    cout << "enter";
    cin >> l;
    cout << "\n";
    for(i=1, letter='A';i<=l;i++,letter++)
    {
    for(j=l;j>=i;j--)
    {
    cout << "!";
    }
    cout <<letter;
    cout << "\n";
    }
    return 0;
    }
  5. dickysolo said:
    @hussanali

    this code is incomplete, some of the alphabets loop needs modification ....though I think you can continue from here...will update if I got it in the meantime....

    first run this and check the result....trying C++ again after leaving college 7 years back....so :D

    #include<iostream.h>
    #include<conio.h>

    int main()
    {
    int i,j,k,l;
    char letter;
    cout << "enter";
    cin >> l;
    cout << "\n";
    for(i=1, letter='A';i<=l;i++,letter++)
    {
    for(j=l;j>=i;j--)
    {
    cout << "!";
    }
    cout <<letter;
    cout << "\n";
    }
    return 0;
    }


    First of all it has to be a C program (printf instead of cout).
    And the most important point to make here is to let the kid do his own homework and maybe learn something.
    @hussanali, like in the code above, use a loop (for or while, I have no idea what chapter you're on) and be careful about how you print the characters.
  6. try this, its in c++. convert the couts and cins-
    #include<iostream.h>
    #include<conio.h>

    void main()
    {
    clrscr();
    int i,x,y;
    char j;
    for(i=6;i>=0;i--)
    {
    for(x=0;x<i;x++)
    cout<<"!";
    for(y=x,j='A';y<6;y++,j++)
    cout<<j;
    cout<<endl;
    }
    getch();
    }
Ask a new question

Read More

Programming Apps