program for following output using for loop?
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Answer Posted / jayaraj.s
#include <stdio.h>
main()
{
int a,b;
for(a=1;a<=5;a++)
{
printf("\n%d",a);
for(b=1;b!=a;b++)
{
printf("%d",a);
}
}
getch();
}
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
How can a string be converted to a number?
Is array a primitive data type in c?
Why is c platform dependent?
What is a constant and types of constants in c?
What is the advantage of a random access file?
int far *near * p; means
Why can’t we compare structures?
What is the difference between Printf(..) and sprint(...) ?
What are the usage of pointer in c?
Differentiate between static and dynamic modeling.
the question is that what you have been doing all these periods (one year gap)
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
What is the benefit of using #define to declare a constant?
Explain what is wrong with this statement? Myname = ?robin?;
Explain how can I convert a string to a number?