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 / devi

#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 ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how do you list files in a directory?

610


What are near, far and huge pointers?

640


What is string concatenation in c?

562


Why calloc is better than malloc?

565


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3045






What is a dynamic array in c?

587


Explain how do you print only part of a string?

642


How can type-insensitive macros be created?

689


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

1757


WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER

1453


explain what are pointers?

610


Why does not c have an exponentiation operator?

620


Can we access array using pointer in c language?

638


How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

648


Explain void pointer?

583