Go Back   Persianhub > Information Center > General Help

Reply
 
LinkBack Thread Tools
Old 12-10-09, 20:11   #1 (permalink)
Lord
 
persian_cutie's Avatar
 
Join Date: Sep 2005
Location: Canada
Posts: 365
Credits: 2,443
Thanks: 46
Thanked 17 Times in 14 Posts
Send a message via MSN to persian_cutie
Arrow Help in programing

can anybody do this in programing C
and explain the codes also. cuz i want to be able to do other shapes!
thaks
_____*
____**
___***
__****
_*****
persian_cutie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-10-09, 20:41   #2 (permalink)
Staff
 
white_hat's Avatar
 
Join Date: Jul 2005
Posts: 5,866
Credits: 540,048
Thanks: 1,660
Thanked 2,115 Times in 734 Posts
omidvaram error nade, beharhal...

3 ta loop dari, yeki vase 5 rows, yeki vase empty spaces va yeki vase stars. har shape e dige khasti dorost koni, you need using nested loops. the first loop for your rows, then u can use the counter in each loop from the other looops within! huh? i cant explain any better lol just practice practice and u'll get it. start with simple shapes
Attached Files
File Type: txt triangle_b.txt (326 Bytes, 8 views)
white_hat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-10-09, 20:47   #3 (permalink)
Lord
 
persian_cutie's Avatar
 
Join Date: Sep 2005
Location: Canada
Posts: 365
Credits: 2,443
Thanks: 46
Thanked 17 Times in 14 Posts
Send a message via MSN to persian_cutie
Quote: Originally Posted by white_hat View Post
hmmm hold on
White_hat mishe msn eto bedi ye chand ta soal dige ham daram...ziyad vaghteto nemigiram.. emtehan daram hichi nemifahmam...moaleme khak bar saram dar hale turkey khordan e javab e-mail nemide
merci
persian_cutie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-10-09, 20:57   #4 (permalink)
Forum Legend
 
arian88's Avatar
 
Join Date: Mar 2004
Location: Norway / Oslo
Posts: 1,634
Credits: 3,511
Thanks: 6
Thanked 7 Times in 7 Posts
Send a message via MSN to arian88 Send a message via Yahoo to arian88
Java, but the are same principle for C or C++..
Search for for loop and check for syntax..

you must use 3 for loop,
the first loop will run your code 5times..

nr 2. will write underscore 5times, and the next time well be one less,
nr 3. the same as nr 2, just inverse , begin from 1 and go up to the 5
Attached Images
File Type: jpg loopTest.JPG (81.0 KB, 5 views)
arian88 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-10-09, 21:04   #5 (permalink)
Staff
 
white_hat's Avatar
 
Join Date: Jul 2005
Posts: 5,866
Credits: 540,048
Thanks: 1,660
Thanked 2,115 Times in 734 Posts
haminja post bezani behtare, ham saritar javab mgiiri, ham javab bedarde baghiye ham mikhore. age soale dige bod man dige zzzzz hastam (3 a.m) amma bachehaye khebre ziad darim komaket mikonan, mesle hamin aghaye arian88
white_hat is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-10-09, 21:09   #6 (permalink)
Forum Legend
 
arian88's Avatar
 
Join Date: Mar 2004
Location: Norway / Oslo
Posts: 1,634
Credits: 3,511
Thanks: 6
Thanked 7 Times in 7 Posts
Send a message via MSN to arian88 Send a message via Yahoo to arian88
for loop yedonash kheyli khobeh bishar beshe kheyli sakht mishe...
makhsosan ke inja shoma bayad baraxesh koni va va va
baraye hamin behtare ke hamash say koni
man alan baraye neveshtane in code 10 min vaght gozashtam
behtarin kar ham ine ke az medad va kaghaz estfadeh koni va logic baraye khodet entekhab koni, badesh hey benevisi toye computer bebini chekar bayad koni ke kar kone ....
arian88 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-10-09, 21:15   #7 (permalink)
Lord
 
persian_cutie's Avatar
 
Join Date: Sep 2005
Location: Canada
Posts: 365
Credits: 2,443
Thanks: 46
Thanked 17 Times in 14 Posts
Send a message via MSN to persian_cutie
Quote: Originally Posted by arian88 View Post
for loop yedonash kheyli khobeh bishar beshe kheyli sakht mishe...
makhsosan ke inja shoma bayad baraxesh koni va va va
baraye hamin behtare ke hamash say koni
man alan baraye neveshtane in code 10 min vaght gozashtam
behtarin kar ham ine ke az medad va kaghaz estfadeh koni va logic baraye khodet entekhab koni, badesh hey benevisi toye computer bebini chekar bayad koni ke kar kone ....
man aslan nafahmidam chi neveshti...bad man vaghat setareh * mikham.
bad man az DevC++ estefade mikonam. erreur mide
persian_cutie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-10-09, 21:18   #8 (permalink)
Forum Legend
 
arian88's Avatar
 
Join Date: Mar 2004
Location: Norway / Oslo
Posts: 1,634
Credits: 3,511
Thanks: 6
Thanked 7 Times in 7 Posts
Send a message via MSN to arian88 Send a message via Yahoo to arian88
Quote: Originally Posted by persian_cutie View Post
man aslan nafahmidam chi neveshti...bad man vaghat setareh * mikham.
bad man az DevC++ estefade mikonam. erreur mide
manam manzore shomaro nafahmidam?
setareh?
Mage soaleton ro javab nadadam?
codi ke white_hat neveshte male C / C++ ast
Codi ke man neveshtam male Java e...
vali taghriban hamone...

Age yek soale jadideh behtar tozih bedid
arian88 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-10-09, 21:24   #9 (permalink)
Lord
 
persian_cutie's Avatar
 
Join Date: Sep 2005
Location: Canada
Posts: 365
Credits: 2,443
Thanks: 46
Thanked 17 Times in 14 Posts
Send a message via MSN to persian_cutie
Quote: Originally Posted by arian88 View Post
manam manzore shomaro nafahmidam?
setareh?
Mage soaleton ro javab nadadam?
codi ke white_hat neveshte male C / C++ ast
Codi ke man neveshtam male Java e...
vali taghriban hamone...

Age yek soale jadideh behtar tozih bedid
na hamoon soale vali vaghat star (*) mikham too code shoma khat (-)ham hast
ino ke mizanam mige system undeclared vali system aslan Ivalue nist. faghat baraye inke safhe nare mizaramesh

#include <stdio.h>
int main()
{
int i,
j,
a,
star = 1;

for(i=5;i>=1;i--)

for(j=1;j<=i;j++){
printf(" ");
}
for(a=1;a<=star;a++){
printf("*");
}
printf("\n");



system("pause");
return 0;
persian_cutie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 12-10-09, 21:32   #10 (permalink)
Forum Legend
 
arian88's Avatar
 
Join Date: Mar 2004
Location: Norway / Oslo
Posts: 1,634
Credits: 3,511
Thanks: 6
Thanked 7 Times in 7 Posts
Send a message via MSN to arian88 Send a message via Yahoo to arian88
inam faghat baraye setareh
Attached Images
File Type: jpg loopTest_2.JPG (85.4 KB, 7 views)
arian88 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Persianhub > Information Center > General Help

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How-To Mips programing jingle General Help 0 19-02-09 00:07


All times are GMT -5. The time now is 14:36.

RSS Feed w3-css w3-xhtml Join us in Facebook
Rules Terms of Services Policy Advertisement

Designed by LastBrush
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
2004 - 2009 © Persianhub Network