how can i get the output
54321
4321
321
21
1

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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the value of uninitialized variable in c?

576


What is pointer to pointer in c?

634


Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1

3661


Can we access array using pointer in c language?

645


What is a string?

666






#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

783


Describe the modifier in c?

603


Explain the red-black trees?

609


Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol

665


What are types of structure?

604


What is masking?

637


How do I get a null pointer in my programs?

620


What is string function in c?

540


How can I implement sets or arrays of bits?

607


Explain what is wrong with this program statement?

621