| | |
Pyramid...questioN??
![]() |
•
•
Join Date: Sep 2006
Posts: 13
Reputation:
Solved Threads: 0
Here's my Prog...i dunno how 2 convert it...pls check..
its a pyramid...
#
is my program correct?
the output must be..a pyramid
its a pyramid...
#
C Syntax (Toggle Plain Text)
#include<stdio.h> main() { int a, b, c, d=0; clrscr(); printf("Enter a No:"); scanf("%d",&c); for(a=1;a<=c;a++) { for(b=1;b<=c*2-1;b++) if (b<=c+d&&b>=c-d) printf("*"); else printf(" "); printf("\n"); d++; } getch(); }
is my program correct?
the output must be..a pyramid
Last edited by darkeinjel04; Oct 11th, 2006 at 5:22 am.
•
•
•
•
Here's my Prog...i dunno how 2 convert it...pls check..
its a pyramid...
#C Syntax (Toggle Plain Text)
#include<stdio.h> main() { int a, b, c, d=0; clrscr(); printf("Enter a No:"); scanf("%d",&c); for(a=1;a<=c;a++) { for(b=1;b<=c*2-1;b++) if (b<=c+d&&b>=c-d) printf("*"); else printf(" "); printf("\n"); d++; } getch(); }
is my program correct?
the output must be..a pyramid
If you want to win, you must not loose (Alan Ford)
•
•
Join Date: Sep 2006
Posts: 13
Reputation:
Solved Threads: 0
•
•
•
•
Here's my Prog...i dunno how 2 convert it...pls check..
its a pyramid...
#C Syntax (Toggle Plain Text)
#include<stdio.h> main() { int a, b, c, d=0; clrscr(); printf("Enter a No:"); scanf("%d",&c); for(a=1;a<=c;a++) { for(b=1;b<=c*2-1;b++) if (b<=c+d&&b>=c-d) printf("*"); else printf(" "); printf("\n"); d++; } getch(); }
is my program correct?
the output must be..a pyramid
Hmmm....yeah, im only asking bcoz my TC is not workign at our house...still thanks for ur advice, i also tried the program..and it work..i only nid the pascal triangle...i've made a program but seems there is a declaration syntax, i can't figure it out what's wrong pls help..
![]() |
Similar Threads
- A question about our dollar bill (Geeks' Lounge)
- Context-sensitive grammar question :( (Computer Science)
- Welcome PC Mod Kingdom peeps! (Geeks' Lounge)
- Laptop LCD built into a car? (Monitors, Displays and Video Cards)
- Changing Network Configuration (*nix Software)
Other Threads in the C Forum
- Previous Thread: Read Line from serial port buffer
- Next Thread: Things I don't understand about C programming -_-
| Thread Tools | Search this Thread |
adobe api array arrays binarysearch calculate char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators intmain() iso kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer posix power probleminc program programming pyramidusingturboccodes read recursion recv recvblocked repetition research scanf scheduling segmentationfault send shape socketprograming socketprogramming stack standard strchr string suggestions systemcall test unix urboc user variable voidmain() wab win32api windows.h






