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



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

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

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

Post New Answer

More C Interview Questions

Why is struct padding needed?

0 Answers  


What is the meaning of 2d in c?

0 Answers  


to get a line of text and count the number of vowels in it

2 Answers  


What are types of structure?

0 Answers  


void main() { //char ch; unsigned char ch; clrscr(); for(ch =0;ch<= 127; ch++) printf(" %c= %d \t ", ch, ch); } output?

4 Answers   Groupon,






What is Function Pointer? Explain with example?

3 Answers  


Describe the difference between = and == symbols in c programming?

0 Answers  


What would be an example of a structure analogous to structure c?

0 Answers  


Explain what is the most efficient way to store flag values?

0 Answers  


what is the output of below code int x=8,y; x>>=2; y=x; what is y value. NOTE:EXPLANATION IS COMPALSARY with binary bits

2 Answers   Wipro,


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics

0 Answers  


Explain 'far' and 'near' pointers in c.

0 Answers  


Categories