how can i get the output
54321
4321
321
21
1

in c programming........???? pls help......

Answers were Sorted based on User's Feedback



how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

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

how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

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

how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

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

how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

Answer / code0090

for more go to
http://answerwale.co.cc/?p=22#comment-18

#include<stdio.h>
#include<conio.h>

int main()
{
int a=5;
int b=9;

while(a!=0){
for(int i=a;i>0;i--)
{
printf("%d",i);
}
printf("\n");
a--;
}
getch();
return 0;
}

Is This Answer Correct ?    6 Yes 8 No

how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

Answer / gohar

a
22
ccc
4444
eeeee
666666

Is This Answer Correct ?    2 Yes 4 No

how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

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

how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

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

how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

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

how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

Answer / aditya the future google ceo

(i=1;i<=5;i--)
{
(J=1;j<=i;j--)

Is This Answer Correct ?    0 Yes 4 No

how can i get the output 54321 4321 321 21 1 in c programming........???? pls help........

Answer / aftab rai

#include<stdio.h>
#include<conio.h>
main()
{
int i,j,n;
printf("enter numbers of lines");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{printf("%d",i+1+j);}
printf("\n");
}
getch();
}

Is This Answer Correct ?    3 Yes 10 No

Post New Answer

More C Interview Questions

write a program to reverse the words in the sentence.NOTE:not reverse the entire string but just the occurance of each word

1 Answers   Sienna Ecad, Wipro,


#include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); } what is the output for this?

4 Answers   IIIT,


struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(ā€œ%dā€,s.x); }

2 Answers   Vector,


How can you draw circles in C?

0 Answers   Accenture,


What is the output for the program given below typedef enum grade{GOOD,BAD,WORST,}BAD; main() { BAD g1; g1=1; printf("%d",g1); }

4 Answers   ADITI,






read an array and search an element

1 Answers  


Write a c code segment using a for loop that calculates and prints the sum of the even integers from 2 to 30, inclusive?

4 Answers  


What is the difference between typedef and #define?

0 Answers  


what is the height of tree if leaf node is at level 3. please explain

0 Answers  


main() { int a[3][4] ={1,2,3,4,5,6,7,8,9,10,11,12} ; int i, j , k=99 ; for(i=0;i<3;i++) for(j=0;j<4;j++) if(a[i][j] < k) k = a[i][j]; printf("%d", k); }

4 Answers   Vector, Wipro, Zoho,


Program to display given 3 integers in ascending order

1 Answers   N Tech,


What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }

0 Answers   Google,


Categories