how can i get output the following...
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
and
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
plz plz...
Answer Posted / anas
for(i=n;i>=1;i--)
{
for(c=1;c<=n-i;c++)
{
cout<<" ";
}
for(k=i;k>=1;k--)
{
cout<<k;
}
cout<<"\n";
}
----------------------------------------------
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
//for second.
int n=1;
for(int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
cout<<n<<" ";
n++;
}
cout<<"\n";
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the data segment that is followed by c?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
plz let me know how to become a telecom protocol tester. thank you.
regarding pointers concept
Write a program with dynamically allocation of variable.
Disadvantages of C language.
develop algorithms to add polynomials (i) in one variable
What is data types?
What is the sizeof () operator?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
What is build process in c?
Do you know the purpose of 'register' keyword?
What is a far pointer in c?
Discuss the function of conditional operator, size of operator and comma operator with examples.