write a program to display the numbers in the following
format
4 4
3 3 3 3
2 2 2 2 2 2
1 1 1 1 1 1 1 1
0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1
2 2 2 2 2
3 3 3
4
Answer Posted / vamsi talapatra
#include<iostream>
using namespace std;
int main(){
int n = 4;
int e = 2;
while(n>0){
for(int i = 0; i< e ; i++){
cout<<n<<" ";
}
cout<<endl;
e=e+2;
n--;
}
while(n<=4){
for(int i = 1; i< e ; i++){
cout<<n<<" ";
}
cout<<endl;
e=e-2;
n++;
}
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Are pointers integers in c?
What is the g value paradox?
will u please send me the placement papers to my mail???????????????????
What is the use of the function in c?
What is the general form of function in c?
What is structure padding in c?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
write a program to print largest number of each row of a 2D array
Which driver is a pure java driver
Explain what is a const pointer?
Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58
What are the 5 types of inheritance in c ++?
How do you determine whether to use a stream function or a low-level function?
What is formal argument?
Is c procedural or object oriented?