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
How can you be sure that a program follows the ANSI C standard?
What is realloc in c?
Why is extern used in c?
What is static volatile in c?
What would happen to X in this expression: X += 15; (assuming the value of X is 5)
Can a function argument have default value?
How do you determine whether to use a stream function or a low-level function?
Is python a c language?
What are the different types of linkage exist in c?
Is it possible to have a function as a parameter in another function?
What's the total generic pointer type?
How are 16- and 32-bit numbers stored?
What is spark map function?
What is the difference between c &c++?
How to implement a packet in C