Tell me a C program to display the following Output?
1 1 1 1 1
2 2 2 2
3 3 3
4 4
5
Answer Posted / deepti
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 9 Yes | 1 No |
Post New Answer View All Answers
State the difference between x3 and x[3].
Is python a c language?
Explain what is the difference between the expression '++a' and 'a++'?
Write a code to remove duplicates in a string.
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
Explain logical errors? Compare with syntax errors.
What is the difference between the local variable and global variable in c?
Why functions are used in c?
Where we use clrscr in c?
What is a char in c?
What is an auto variable in c?
what value is returned to operating system after program execution?
Which is better between malloc and calloc?
What do you understand by normalization of pointers?
What is #include stdio h and #include conio h?