BlueJ Tutorial |
Pattern on characters using BlueJ and C Language Posted: 03 Dec 2012 09:45 PM PST Here is a pattern given below and the pattern will be displayed using both BlueJ and C Language. ABCDE BCDE CDE DE E f fg fgh fghi fghij BlueJ program of the pattern class archisman { int i,j,n=5; char ch; public void show() { for(i=0;i<10 i="i" span="span">10> { if(i<5 span="span">5> { ch='A'; ch=(char)(ch+i); } else ch='f'; for(j=0;j { System.out.print(ch); ch=(char)(ch+1); } if(i>=5) n++; else if(i<4 span="span">4> n--; System.out.println(); } } } Same program using c language #include void main() { int i,j,n=5; char ch; clrscr(); for(i=0;i<10 i="i" span="span">10> { if(i<5 span="span">5> { ch='A'; ch=ch+i; } else ch='f'; for(j=0;j { printf("%c",ch); ch=ch+1; } if(i>=5) n++; else if(i<4 span="span">4> n--; printf("\n"); } getch(); } |
You are subscribed to email updates from Tutorial Site On BlueJ for ICSE and ISC Students, C and Data Structure, C++ For Engineering Students To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 20 West Kinzie, Chicago IL USA 60610 |
Post a Comment