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

What are the advantages of union?

639


What is variables in c?

615


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

1429


What is the difference between procedural and functional programming?

530


What is wrong with this statement? Myname = 'robin';

833






int i=10; printf("%d %d %d", i, i=20, i);

1022


What is the main difference between calloc () and malloc ()?

583


Why flag is used in c?

664


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

756


What type is sizeof?

595


Is there anything like an ifdef for typedefs?

714


What is the difference between malloc() and calloc() function in c language?

615


Is Exception handling possible in c language?

1592


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.

2463


Tell us two differences between new () and malloc ()?

619