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


Please Help Members By Posting Answers For Below Questions

What is the general form of a C program?

593


Explain what is dynamic data structure?

640


What are the advantages of union?

622


main() { printf("hello"); fork(); }

685


What is difference between constant pointer and constant variable?

618






simple program of graphics and their output display

1462


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2213


What is a buffer in c?

566


How do you search data in a data file using random access method?

823


How can you invoke another program from within a C program?

609


Whats s or c mean?

589


What is structure padding and packing in c?

610


What is pragma c?

603


How can I prevent another program from modifying part of a file that I am modifying?

606


What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?

927