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


Please Help Members By Posting Answers For Below Questions

State the difference between x3 and x[3].

648


Is python a c language?

548


Explain what is the difference between the expression '++a' and 'a++'?

623


Write a code to remove duplicates in a string.

623


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

591






Explain logical errors? Compare with syntax errors.

618


What is the difference between the local variable and global variable in c?

525


Why functions are used in c?

580


Where we use clrscr in c?

694


What is a char in c?

552


What is an auto variable in c?

748


what value is returned to operating system after program execution?

1595


Which is better between malloc and calloc?

664


What do you understand by normalization of pointers?

619


What is #include stdio h and #include conio h?

592