12344321
123 321
12 21
1 1 how i print this program??
Answer Posted / vamsi talapatra
#include<iostream>
using namespace std;
int main(){
int n = 4;
while(n>0){
for(int i = 1; i<=n; i++){
cout<<i;
}
cout<<" ";
for(int i = n; i>0; i--){
cout<<i;
}
n--;
cout<<endl;
}
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is sizeof array?
Write a program to print factorial of given number without using recursion?
Explain the term printf() and scanf() used in c language?
What happens if you free a pointer twice?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
How was c created?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
What is meant by high-order and low-order bytes?
What does c mean before a date?
What are valid signatures for the Main function?
What is new line escape sequence?
How can I change the size of the dynamically allocated array?
Write a program to use switch statement.
Explain how do you list files in a directory?