Sign in with
Sign up | Sign in
Your question

Help me in this C program!

Last response: in Applications
Share
March 22, 2012 4:07:19 PM

Can somebody please write this program in C language!

More about : program

a b L Programming
March 22, 2012 4:56:56 PM

No. Not going to do your homework for you. it's for your own good in the long run.
m
0
l
March 23, 2012 5:11:18 PM

Ijack said:
No. Not going to do your homework for you. it's for your own good in the long run.


+1
m
0
l
Related resources
March 23, 2012 5:14:01 PM

@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?
m
0
l
March 24, 2012 6:26:15 PM

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;
}
m
0
l
March 24, 2012 10:58:55 PM

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.
m
0
l
July 30, 2012 6:46:00 AM

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();
}
m
0
l
!