code snippet for creating a pyramids triangle
ex
1
2 2
3 3 3
Answer Posted / vignesh1988i
A SMALL IMPLEMENTATION OF POINTERS
#include<stdio.h>
#include<conio.h>
void main()
{
int n,*p,*q;
printf("enter the number of lines :");
scanf("%d",&n);
for(int i=1,p=&i;*p<=n;*p++)
{
printf("\n");
for(int j=1,q=&j;*q<=*p;*q++)
{
printf("%d",*p);
printf(" ");
}
}
getch();
}
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What are the advantages of union?
What is variables in c?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
What is the difference between procedural and functional programming?
What is wrong with this statement? Myname = 'robin';
int i=10; printf("%d %d %d", i, i=20, i);
What is the main difference between calloc () and malloc ()?
Why flag is used in c?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
What type is sizeof?
Is there anything like an ifdef for typedefs?
What is the difference between malloc() and calloc() function in c language?
Is Exception handling possible in c language?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
Tell us two differences between new () and malloc ()?