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 is the -> in c?
Array is an lvalue or not?
Explain what is the difference between the expression '++a' and 'a++'?
Should a function contain a return statement if it does not return a value?
Where in memory are my variables stored?
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
What is header file in c?
What is difference between main and void main?
Can you define which header file to include at compile time?
Explain about the functions strcat() and strcmp()?
Difference between Shallow copy and Deep copy?
What language is lisp written in?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
Why is c called c?
Subtract Two Number Without Using Subtraction Operator