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
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
Why is main function so important?
Difference between Shallow copy and Deep copy?
What is a structure and why it is used?
How can I manipulate strings of multibyte characters?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
In c language can we compile a program without main() function?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What is a sequential access file?
praagnovation
What is calloc()?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
What does do in c?
What language is windows 1.0 written?
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.