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 |
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
What is an volatile variable?
Explain the term printf() and scanf() used in c language?
What is the diffrent between while and do while statement ?
Program to find the value of e raised to power x using while loop
What is null pointer constant?
what are threads ? why they are called light weight processes ? what is the relation between process and threads ?
What is the difference between char array and char pointer?
Can you please explain the difference between strcpy() and memcpy() function?
Write a program to check prime number in c programming?
What is a substring in c?
What are the usage of pointer in c?