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

any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

919


State the difference between realloc and free.

838


Is there anything like an ifdef for typedefs?

905


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

836


What are structural members?

791


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

993


What is data structure in c language?

845


List the difference between a While & Do While loops?

860


why return type of main is not necessary in linux

1887


What are the different types of endless loops?

840


What is the most efficient way to store flag values?

911


hi send me sample aptitude papers of cts?

1891


write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.

5218


Why #include is used in c language?

799


What is the time and space complexities of merge sort and when is it preferred over quick sort?

880