turbo C Question 5.

turbo C Question 5.

is it possible to print "", 1st line (5 times),2nd line *(4 times),3rd line *(3 times),4th line *(2 times) & 5th line *(1 times) with Align Right. and also reverse order as 1,2,3,4,5 (but right aline) like pyramid.

View Answers

February 27, 2012 at 1:11 PM

*
**
***
****
*****

class Pyramid{
   public static void main(String args[]){
       for(int i=1;i<=5;i++){
           for(int j=1;j<=i;j++){
               System.out.print("*");
           }
           System.out.println();
       }

   }
}

February 27, 2012 at 1:12 PM

*****
****
***
**
*

class Pyramid{
   public static void main(String args[]){
          for(int i=5;i>=1;i--){
           for(int j=1;j<=i;j++){
               System.out.print("*");
           }
           System.out.println();
       }
   }
}

February 27, 2012 at 1:17 PM

    *
   **
  ***
 ****
*****

class Pyramid{
   public static void main(String args[]){
       for(int i=1;i<=5;i++){
          for (int j = 0; j < 5-i; j++){
         System.out.print(" ");
       }
           for(int j=1;j<=i;j++){
               System.out.print("*");
           }
           System.out.println();
       }
   }
}

February 27, 2012 at 1:17 PM

*****
 ****
  ***
   **
    *

class Pyramid{
   public static void main(String args[]){


          for(int i=5;i>=1;i--){
               for (int j = 0; j < 5-i; j++){
         System.out.print(" ");
       }
           for(int j=1;j<=i;j++){
               System.out.print("*");
           }
           System.out.println();
       }
   }
}

February 27, 2012 at 1:22 PM

*
**
***
****
*****

#include <stdio.h>
#include <conio.h>

  void main(){
       for(int i=1;i<=5;i++){
           for(int j=1;j<=i;j++){
             printf("*");
           }
           printf("\n");
       }

   }



*****
****
***
**
*

#include <stdio.h>
#include <conio.h>

  void main(){
      for(int i=5;i>=1;i--){
           for(int j=1;j<=i;j++){
              printf("*");
           }
            printf("\n");
       }
   }



    *
   **
  ***
 ****
*****

#include <stdio.h>
#include <conio.h>

  void main(){
       for(int i=1;i<=5;i++){
          for (int j = 0; j < 5-i; j++){
          printf(" ");
       }
           for(int j=1;j<=i;j++){
          printf("*");
           }
          printf("\n");
       }
   }


*****
 ****
  ***
   **
    *

#include <stdio.h>
#include <conio.h>

  void main(){
          for(int i=5;i>=1;i--){
               for (int j = 0; j < 5-i; j++){
               printf(" ");
             }
           for(int j=1;j<=i;j++){
              printf("*");
           }
             printf("\n");
       }
   }









Related Tutorials/Questions & Answers:
turbo C Question 5.
turbo C Question 5.  is it possible to print "", 1st line (5 times),2nd line *(4 times),3rd line *(3 times),4th line *(2 times) & 5th line *(1 times) with Align Right. and also reverse order as 1,2,3,4,5 (but right aline
turbo C Question 6.
turbo C Question 6.  Explain call by value and call by reference with easy examples
Advertisements
turbo C Question 4.
turbo C Question 4.  Possible to print the following (Using for Loops): 1. * ** 2.* * ** * * * *   specify the format properly
turbo C Question 4.
turbo C Question 4.  Possible to print the following (Using for Loops): 1. * ** 2.* * ** * * * *   specify the format properly
turbo c pre-increment question
turbo c pre-increment question  Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times
turbo C prog.
turbo C prog.  Is is possible print ASCII value of a alphabets using turbo C prog
turbo C prog.
turbo C prog.  Is it possible to print ASCII value A to Z with out...;#include<stdio.h> #include<conio.h> void main() { for(char c='A';c<='Z';c++){ printf("\nASCII of %c is %i\n", a, a); } getch(); } C
Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times)
Can u print in turbo C  Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times
turbo C prog. Q3
turbo C prog. Q3  What is the difference between if and ladder... } Example of ladder if: #include <stdio.h> main() { int a,b,c; printf("enter values for a,b,c"); scanf("%d%d%d",&a,&b,&c); if(a>
Conditional Statement in Turbo C
Conditional Statement in Turbo C   Write a program that computes and assesses the tuition fee of the students in one trimester, based on the given...% Discount Two-installment (2) 5% Discount Three-Installment (3) 10% Interest The target
Conditional Statement in Turbo C
Conditional Statement in Turbo C   Write a program that computes and assesses the tuition fee of the students in one trimester, based on the given...% Discount Two-installment (2) 5% Discount Three-Installment (3) 10% Interest The target
how to get following answer in turbo c program
how to get following answer in turbo c program  input 123456789 output 1 2 3 4 5 6 7 8 9
Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times)
Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print ++a in the same printf() command ten times)  Can u print in turbo c 9 8 7 6 5 4 3 2 1 0 using pre increment operator Only use print
(ForPro) turbo C prog. Q4
(ForPro) turbo C prog. Q4  I need to learn some easy foxpro program.. for example sum,interchange, loop etc
C# question
Create a Solution by name Bank with Classes Account.cs, SavingsAccount.cs and savingsTest.cs to Demonstrate Abstract Classes in C#  1st question... and savingsTest.cs to Demonstrate Abstract Classes in C
question for c++
question for c++   write Program to swap between two numbers if first number is greater than second number and total of two numbers greater than 10
C# question
C# question  Explain enumeration base types in C
C# question
C# question  In C#, string is a class or primitive type. Explain
C# question
C# question  Write a program in C# to create 3*4 matrix and show the sum of diagonal values
C# question
C# question  Write a program in C# to create 3*4 matrix and show the sum of diagonal values
C# question
C# question  How can we call method pass by reference in C
c question
c question  How to convert decimal numbers into binary digits without using pow function in c language
question for c++
question for c++   write Program to swap between two numbers if first number is greater than second number and total of two numbers greater than 10   Ã?¨Ã?±Ã?â? Ã?§Ã?â?¦Ã?¬ Ã?â??Ã?â?¦Ã?¨Ã?§Ã?¯Ã?â??Ã?© Ã?¨Ã
C/C++/JAVA Question on function
C/C++/JAVA Question on function  "Write a function to find out common... other data type also.ââ?¬Â? Question can be solved in C,C++ or JAVA. (Recommneded - C
C++ question 3
C++ question - add the two matrices and display the elements of resultant....   C sum of two matrices The given code allow the user to enter...; #include <conio.h> void main() { int m, n, c, d, first[10][10], second[10
C++ Question 2
C++ Triangle and Rectangle - calculate area of Triangle and rectangle using data members from base class  2.create class. Shape accepts two values (Data Type: Double). Create two derived classes Triangle and Rectangle ; calculate
C Program Question - Development process
C Program Question  How i can calulate sum of First digit and last digit of Five Numbers. e.g 12345 i want to calculate 1+5=6 how i can calculate in C Program?   Hi Friend, Try the following code
c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used
c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used
c++
c++  i use turbo c++...i want to change the background color...what is the command for it and the header file used
please help me to answers this question about C++.....huuhuhuhu
please help me to answers this question about C++.....huuhuhuhu  1... clock to measure the running time c) Use several input (eg: N = 100 , N = 1000... violation?. What does it mean? How to avoid it? 5) For each of the following four
please help me to answers this question about C++.....huuhuhuhu
please help me to answers this question about C++.....huuhuhuhu  1... clock to measure the running time c) Use several input (eg: N = 100 , N = 1000... violation?. What does it mean? How to avoid it? 5) For each of the following four
ModuleNotFoundError: No module named 'turbo'
ModuleNotFoundError: No module named 'turbo'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'turbo' How to remove the ModuleNotFoundError: No module named 'turbo'
C/C++ - Development process
C/C++  I need the code for playing the backgammon game using C/C++.Im using turbo C. I`ve already design the board.I badly need the code for playing this game
C++
C++  Hi I do not understand the question stated below. Does anyone... for clarification on the above question. Element a b c ââ?¬Â¦Ã¢â?¬Â¦Ã¢â?¬Â¦ x y z Index 0 1 2... and the second row are the two generated numbers. b g c z k e <- letter index
c++
c++  .write a program that accepts 5 subjects of a student,it should have a function to calculate the average & another function to grade.grade should be as follows-<40=E,40-49=D,50-59=C,60-69=B & >70
ModuleNotFoundError: No module named 'turbo-clipper'
ModuleNotFoundError: No module named 'turbo-clipper'  Hi, My... 'turbo-clipper' How to remove the ModuleNotFoundError: No module named 'turbo-clipper' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'turbo-dash'
ModuleNotFoundError: No module named 'turbo-dash'  Hi, My Python... 'turbo-dash' How to remove the ModuleNotFoundError: No module named 'turbo-dash' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'turbo-disco'
ModuleNotFoundError: No module named 'turbo-disco'  Hi, My Python... 'turbo-disco' How to remove the ModuleNotFoundError: No module named 'turbo-disco' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'turbo-markdown'
ModuleNotFoundError: No module named 'turbo-markdown'  Hi, My... named 'turbo-markdown' How to remove the ModuleNotFoundError: No module named 'turbo-markdown' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'turbo_motor'
ModuleNotFoundError: No module named 'turbo_motor'  Hi, My Python... 'turbo_motor' How to remove the ModuleNotFoundError: No module named 'turbo_motor' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'turbo_react'
ModuleNotFoundError: No module named 'turbo_react'  Hi, My Python... 'turbo_react' How to remove the ModuleNotFoundError: No module named 'turbo_react' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'turbo-seti'
ModuleNotFoundError: No module named 'turbo-seti'  Hi, My Python... 'turbo-seti' How to remove the ModuleNotFoundError: No module named 'turbo-seti' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'turbo_sqlalchemy'
ModuleNotFoundError: No module named 'turbo_sqlalchemy'  Hi, My... named 'turbo_sqlalchemy' How to remove the ModuleNotFoundError: No module named 'turbo_sqlalchemy' error? Thanks   Hi, In your
c++
c++  .write a prgrm tht accepts 5 subjects of a student,it shld hv a function to calculate the average & another function to grade.grade shld be as follows-<40=E,40-49=D,50-59=C,60-69=B & >70
C++
C++  write a prgrm tht gets five values,gets the sum,average &...; #include <conio.h> void main() { clrscr(); int a,b,c,d,e,sum; float average; long product; cout << "Enter 5 integers : " << endl; cin>>b>
c++
c++  Write a console based C++ program that reads student information...;= 50) 5) Display the student name with the maximum GPA 6) Display the student name with the minimum GPA 7) Display Student GPAs as Letter Grades (A, B, C, D
C++
C++  How can i write this in dev c
C++
C++  How can i write this in dev c
c#
c#  how to find out the size of the BMP image in C

Ads