[Help] C Programming

Status
Not open for further replies.
I need to write some programs in C Language that will Print the
Following Outputs:

I]
@@@@
*@@@
**@@
***@

II]
@@@@@@@@@@
@@@@***@@@@
@@@******@@@
@@*********@@
@************@


III]
******@
*****@@
****@@@
***@@@@

Note that only the @ symbols need to be printed.Only loops like For,While
& If...Else are Permitted.Any Help will be highly apppreciated.......

No matter How hard i've tried,I could'nt figure out how to do it.
I heard that the Digit Family is a very Helpful one when it comes to
newbies.I Sincerely Hope that this message of mine shall not be
Deleted/Banned......Hoping for an early Reply.

Adios...
 

NikhilVerma

Padawan
I am rather bothered by your username...
Are you a member of the KuKluxKlan?
Or you really appretiate them?

Coz they are virtual terrorists....
 

technovice

Broken In
yeah why KuKluxKlan...i mean even Sherlock Holmes fears them :lol:

neways heres my solutions
not tried them out though
hope they work !!

1]
for(i=0;i<4;i++)
{
for(j=0;j<i;j++)
printf(" ");
for(j=0;j<4-i,i++)
printf("@");
printf("\n");
}

2]
for(i=0; i<5;i++)
{
for(j=0;j<5-i;j++)
printf("@");
for(j=0;j<i;j++)
printf(" ");


for(j=0;j<i;j++)
printf(" ");
for(j=0;j<5-i;j++)
printf("@");

printf("\n");
}



3]
for(i=0;i<4;i++)
{
for(j=0;j<4-i;j++)
printf(" ");
for(j=0;j<i+1;j++)
print("@");
printf("\n");
}

I'm assuming the '*' are blank spaces
 

cool_dude_prav

In the zone
@technovice...

Thot I wud give the answers but see tat ya has given the right answers...

Anyways, my word of appreciation for helping the fella...
 
OP
P

prasadzmultiplex

Broken In
Thank you technovice for helping me out with the programs......

I gotta check them out.But I have a problem.I formatted my PC
Recently and do not have the Turbo C Editor.Is there anywhere I can
Download it off the net?

I am a Std X student & Am trying to learn C on my own from some
Books by Yeshwant kanetkar. Until now i had done only simple programs
on my own.But now the going seems tough.

Thank You Once Again For Your Help.
 

Kl@w-24

Slideshow Bob
Free download here :

*www.borland.com/products/downloads/download_cbuilder.html

Also see this :

*community.borland.com/article/0,1410,20841,00.html

*community.borland.com/article/0,1410,21751,00.html
 
OP
P

prasadzmultiplex

Broken In
Thanx a lot Guys....

That made my programming easier...
though i still am in the dark regarding Functions n NEsted Functions...

any tutorials?
 

tuxfan

Technomancer
What do you want to know about functions? Let us know. May be we can help :)

What do you mean by nested functions? Or is it nested loops?

But I think you are already referring to a book by Kanetkar. Does it not explain enough?

BTW, you have a deadly username!! :D KuKluxKlan!! What a name!! :lol:
 

lamrinnirmal

Journeyman
thats a crazy nick! hope you aint like em(the klan!)

dude go to *www.programmersheaven.com
you ll get all the tutorials and tools you need.
 
OP
P

prasadzmultiplex

Broken In
lamnirmal said:
thats a crazy nick! hope you aint like em(the klan!)
Not at all :oops:
Jus' that I tried 2-3 Variations of My name(which is a Quite Common One)
and was disappointed-There were already used.....So Thot of this Unique one

lamnirmal said:
dude go to *www.programmersheaven.com
you ll get all the tutorials and tools you need

Thanx for that Link......I read some and were helpful....
But can I download them as eBooks? or any other Way???

tuxfan said:
What do you want to know about functions? Let us know. May be we can help
Functions are Somewhat Easy.....Just the Nested ones have me in a Tizzy

tuxfan said:
What do you mean by nested functions? Or is it nested loops?
Nested Functions=Functions Within Functions.....They're a bit confusing...
Particularly the ones with many nestings.....

tuxfan said:
But I think you are already referring to a book by Kanetkar. Does it not explain enough?
Yeah..It helps...but There's
No One to Xplain to me....i'm all on my own.....

tuxfan said:
BTW, you have a deadly username!! KuKluxKlan!! What a name!!
Thanxxx for the Appreciation......
 

aadipa

Padawan
KuKluxKlan said:
tuxfan said:
What do you want to know about functions? Let us know. May be we can help
Functions are Somewhat Easy.....Just the Nested ones have me in a Tizzy

tuxfan said:
What do you mean by nested functions? Or is it nested loops?
Nested Functions=Functions Within Functions.....They're a bit confusing...
Particularly the ones with many nestings.....

What are those NESTED FUNCTIONs ?
 

Tech&ME

Banned
dude the book by Yeshwant kanetkar is pretty good one there , even we had used it during our early college days. Why don't u try book meant for new programmers, like book by DUMMIES --- C++ Programming For Dummies 3rd Edition by Stephen R. Davis, it a good book for starters.
 

lamrinnirmal

Journeyman
dude KuKlux pm me your email .... i ll host a few ebooks on C on a hosting server where you can download em off........or just search the forum....there are quite a lot of links to ebook sites(all legal!)

about nested functions............hope the below code clears your confusion.

imagine of a traveller moving to the different countries from main and when hes in australia() he doesnt go to anyother place(cause australia() doesnt call any function) and thus to find his way back to main he climbs up the way he came down.........

Code:
void india();
void england();
void usa();
void australia();

void main()
{
printf(" i am in main");
india();
printf("jus got back from india!.......finally here...what a ride");
}

void india()
{
printf("im in india! ");
england();
printf("jus got back from england.....!");
return;
}

void england()
{
printf("im in england.......the queen aint hot!");
usa();
printf("jus got back from usa");
return;
}

void usa()
{
printf("im in usa......so whats so great bout this place?pathetic!");
australia();
printf("got back from australia");
return;
}

void australia()
{printf("lost in the outbacks!.....gotta find myself way back");
return;
}


your output would be.....

i am in main
im in india!
im in england.......the queen aint hot!
im in usa......so whats so great bout this place?pathetic!
lost in the outbacks!.....gotta find myself way back
got back from australia( now you are in usa)
jus got back from usa(now in england)
jus got back from england.....!(now in india)
jus got back from india!.......finally here...what a ride(home sweet main.....program ends
 
Status
Not open for further replies.
Top Bottom