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
Can we change the value of static variable in c?
Why C language is a procedural language?
How is null defined in c?
Why is c not oop?
Why do we use int main?
Write a program to swap two numbers without using third variable in c?
What do you mean by keywords in c?
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Differentiate between Macro and ordinary definition.
Write a C program in Fibonacci series.
Why do some versions of toupper act strangely if given an upper-case letter?
When should a far pointer be used?
What is structure padding and packing in c?
using for loop sum 2 number of any 4 digit number in c language
Why doesnt this code work?