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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
Answer / sreesen@ymail.com
#include<stdio.h>
void main()
{
int i,j,k=5;
for(i=1;i<=5;i++)
{
for(j=k;j<=0;j--)
{
printf("%d",i);
}
printf(""\n);
k--;
}
Is This Answer Correct ? | 2 Yes | 2 No |
What is getche() function?
Why is c called c not d or e?
How to calculate sum
What are the loops in c?
Why do u use # before include in a C Progam?
code for selection sort?
Explain how do you search data in a data file using random access method?
Can i use Two or More Main Funtion in any C program.?
What should malloc(0) do?
Explain what standard functions are available to manipulate strings?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
Differentiate between a for loop and a while loop? What are it uses?