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


Please Help Members By Posting Answers For Below Questions

void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1257


What are all different types of pointers in c?

577


What is include directive in c?

644


Describe the order of precedence with regards to operators in C.

633


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

655






What is pragma in c?

627


How variables are declared in c?

571


How do c compilers work?

609


How can you increase the size of a statically allocated array?

612


If I have a char * variable pointing to the name of a function ..

652


What is meant by int main ()?

716


Write a program to print “hello world” without using semicolon?

672


What are variables c?

616


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2411


How is pointer initialized in c?

585