1 2 3 2 3 4 5 4 3 4 5 6 7 6 5 4 5 6 7 8 9 8 7 6 5
I am trying to do this program but not able to get output can anyone help me
-
Manam - 1485 Views
- 9 Answers
Hi Harish,br /Use this code it will work...to get more understand on the logic i kept more spaces..if you don't want u can comment those statements.br /br //*br /Program : Pattern Program of printing... 1 2 3 2 3 4 5 4 3 4 5 6 7 6 5 4 5 6 7 8 9 8 7 6 5br /Author : Rajanikanthbr /Language: C++br /Email : rnvrk.2015@gmail.combr /*/br /br /#include<iostream>br /using namespace std;br ///1 2 3 2 3 4 5 4 3 4 5 6 7 6 5 4 5 6 7 8 9 8 7 6 5br /int main()br /{br /int num, noft; //number of timesbr /int rep=0; //repetitionbr /cout<<"How many times you want to repeat this pattern...";br /cin>>noft;br /for(int cnt=1; cnt<=noft; cnt++)br /{br /for(num=cnt; num<=cnt+rep; num++)br /cout<<num<<" ";br /for(num=num-2; num>=cnt; num--)br /cout<<num<<" ";br /cout<<" ";br /rep++;br /}br /}
-
- 28 Apr
- 0 Comments
- Share
Didn't get the answer.
Contact people of Talent-Core Java directly by clicking here
-
How to iterate through a text file and search records in a java program?
-
What are the best way to get more knowledge about programming
-
Why does arguments in the methods are initialized with their default value in Java?
-
How do I stop getting emails from this website?
-
In This Program uses the topic are String and StringBuffer and etc.
-
can i compile a java file using classpath and that java file is present in some other directory
-
How does Yout4Work place students based on percentile?
-
this program is not working correctly
-
Illgal argument Exception in getDeclaredConstructor
-
If class is declared abstract then why abstract keyword used before method in abstract class?