how can i get the output
54321
4321
321
21
1
in c programming........???? pls help......
Answers were Sorted based on User's Feedback
Answer / jayaraj.s
#include<stdio.h>
main()
{
int a,b;
for(a=5;a!=0;a--)
{
for(b=a;b!=0;b--)
{
printf("%d",b);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 86 Yes | 16 No |
Answer / narasimharao
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
scanf("%d",&n);
for(i=n;i>=1;i--)
{
for(j=i;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 28 Yes | 12 No |
Answer / dattatreya
#include<stdio.h>
int main(){
char a[6]="54321";
char *p=a;
while(*p){
printf("%s ",p++);
}
return 0;
}
Is This Answer Correct ? | 8 Yes | 3 No |
Answer / rishabh upadhyay
#include<stdio.h>
void main(){
int i,j=5,temp=0;
for (i=1;i<=5;i++)
{
for (j=5-temp;j>=1;j--)
{
printf("%d",j);
}
printf("
");
temp=temp+1;
}
}
Is This Answer Correct ? | 1 Yes | 4 No |
Answer / nagulmeera
#include<stdio.h>
#include<conio.h>
main()
{
for(int i=5;i<0;i--)
{
for(j=i;j!=0;j--)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 4 Yes | 8 No |
Answer / mydeen
for(i=5;i<0;i++)
{
for(j=i;j<0;j++)
{
printf("%d",&i);
}
}
Is This Answer Correct ? | 3 Yes | 7 No |
Answer / aditya the future google ceo
(i=1;i<=5;i--)
{
(J=1;j<=i;j--)
Is This Answer Correct ? | 0 Yes | 4 No |
is forign key will be unique key any table or not?
provide an example of the Group by clause, when would you use this clause
Why structure is used in c?
how to implement stack work as a queue?
What is the Difference between Macro and ordinary definition?
3 Answers Bosch, Cognizant, College School Exams Tests, Motorola,
What do you mean by recursion in c?
If we give two names then this displays the connection between the two people. It is nothing but flames game
what is data structure?
What is the Difference between Class and Struct?
Difference between null pointer and dangling pointer?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
How to reverse a string using a recursive function, without swapping or using an extra memory?
31 Answers Cisco, Mind Tree, Motorola, Ophio, Sony, TCS, Wipro,