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

Can we change the value of static variable in c?

552


Why C language is a procedural language?

613


How is null defined in c?

645


Why is c not oop?

533


Why do we use int main?

598






Write a program to swap two numbers without using third variable in c?

607


What do you mean by keywords in c?

614


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

637


Differentiate between Macro and ordinary definition.

718


Write a C program in Fibonacci series.

622


Why do some versions of toupper act strangely if given an upper-case letter?

624


When should a far pointer be used?

591


What is structure padding and packing in c?

609


using for loop sum 2 number of any 4 digit number in c language

1725


Why doesnt this code work?

609