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
How does pointer work in c?
How can I find out if there are characters available for reading?
What is meant by preprocessor in c?
Why is c fast?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What is the maximum no. of arguments that can be given in a command line in C.?
What are the different types of linkage exist in c?
What kind of structure is a house?
what is the diffrenet bettwen HTTP and internet protocol
what do you mean by enumeration constant?
What is structure in c explain with example?
Who invented bcpl language?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
Write a program to print “hello world” without using semicolon?
Explain how do you generate random numbers in c?