Write a program to accept a number and to print numbers in
pyramid format?
for eg:for a no. 5
1
212
32123
4321234
543212345
Answer Posted / pravin pawar
public static void main(String args[])
{
for(int r=1;r<=5;r++)
{
for(int s=5-r;s>0;s--)
System.out.print(" ");
for(int c=r;c>=1;c--)
System.out.print(c);
for(int c=2;c<=r;c++)
System.out.print(c);
System.out.print("\n");
}
}
| Is This Answer Correct ? | 8 Yes | 3 No |
Post New Answer View All Answers
Give two or more real cenario of virtual function and vertual object
write string class as your own class in java without using any built-in function
#include
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
What polymorphism means?
What is object-oriented programming? Webopedia definition
Can destructor be overloaded?
Can bst contain duplicates?
What is polymorphism what are the different types of polymorphism?
What is abstraction in oop with example?
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.
What is the real time example of inheritance?
What is balance factor?
Write a program to sort the number with different sorts in one program ??
How oops is better than procedural?