program for following output using for loop?
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Answer Posted / aky
#include<iostream.h>
#include<conio.h>
void main()
{
for(int i=1;i<=10;i++)
{
for(int j=1;j<=i;j++)
{
cout<<j;
}
cout<<endl;
}
}
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
How was c created?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
How can you tell whether a program was compiled using c versus c++?
What is a buffer in c?
Write the syntax and purpose of a switch statement in C.
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What is the difference between procedural and functional programming?
Differentiate fundamental data types and derived data types in C.
Explain how can I write functions that take a variable number of arguments?
Explain how can you tell whether a program was compiled using c versus c++?
What is queue in c?
Is that possible to add pointers to each other?
When is a “switch” statement preferable over an “if” statement?
Why is structure important for a child?