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
What is scanf () in c?
What is the correct code to have following output in c using nested for loop?
What is getch?
How can you avoid including a header more than once?
Why does everyone say not to use scanf? What should I use instead?
What is file in c language?
What is dynamic memory allocation?
Why header files are used?
In c language can we compile a program without main() function?
can we implement multi-threads in c.
Explain how do you search data in a data file using random access method?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
Describe the order of precedence with regards to operators in C.
Is malloc memset faster than calloc?
What are the different types of constants?